From 27750f375211e1428dc9d5911fef7074dbd38658 Mon Sep 17 00:00:00 2001 From: Eder Monteiro Date: Fri, 1 Dec 2023 16:07:22 -0300 Subject: [PATCH 01/13] ppl: turn mirrored pins log info into debug print Signed-off-by: Eder Monteiro --- src/ppl/src/IOPlacer.cpp | 25 ++++++++++++++----------- src/ppl/src/IOPlacer.tcl | 1 - src/ppl/test/add_constraint10.ok | 4 ---- src/ppl/test/add_constraint11.ok | 5 ----- src/ppl/test/add_constraint12.ok | 4 ---- src/ppl/test/add_constraint13.ok | 2 -- src/ppl/test/add_constraint14.ok | 5 ----- src/ppl/test/add_constraint15.ok | 1 - src/ppl/test/add_constraint9.ok | 4 ---- src/ppl/test/add_constraint_debug.ok | 8 ++++---- src/ppl/test/add_constraint_debug.tcl | 2 +- src/ppl/test/annealing_mirrored1.ok | 11 ----------- src/ppl/test/annealing_mirrored2.ok | 11 ----------- src/ppl/test/annealing_mirrored3.ok | 11 ----------- src/ppl/test/annealing_mirrored4.ok | 11 ----------- src/ppl/test/annealing_mirrored5.ok | 11 ----------- src/ppl/test/random9.ok | 2 -- src/ppl/test/write_pin_placement3.ok | 11 ----------- src/ppl/test/write_pin_placement4.ok | 10 ---------- 19 files changed, 19 insertions(+), 120 deletions(-) diff --git a/src/ppl/src/IOPlacer.cpp b/src/ppl/src/IOPlacer.cpp index aa142dae0f6..a7d3ecf4dab 100644 --- a/src/ppl/src/IOPlacer.cpp +++ b/src/ppl/src/IOPlacer.cpp @@ -1571,16 +1571,16 @@ void IOPlacer::addNamesConstraint(PinSet* pins, Edge edge, int begin, int end) pin_names += pin->getName() + " "; pin_cnt++; if (pin_cnt >= pins_per_report_ - && !logger_->debugCheck(utl::PPL, "report_pin_names", 1)) { + && !logger_->debugCheck(utl::PPL, "pin_groups", 1)) { pin_names += "... "; break; } } - if (logger_->debugCheck(utl::PPL, "report_pin_names", 1)) { + if (logger_->debugCheck(utl::PPL, "pin_groups", 1)) { debugPrint(logger_, utl::PPL, - "report_pin_names", + "pin_groups", 1, "Restrict pins [ {}] to region {:.2f}u-{:.2f}u at the {} edge.", pin_names, @@ -1634,6 +1634,13 @@ void IOPlacer::addTopLayerConstraint(PinSet* pins, const odb::Rect& region) void IOPlacer::addMirroredPins(odb::dbBTerm* bterm1, odb::dbBTerm* bterm2) { + debugPrint(logger_, + utl::PPL, + "mirrored_pins", + 1, + "Mirroring pins {} and {}", + bterm1->getName(), + bterm2->getName()); mirrored_pins_[bterm1] = bterm2; } @@ -1901,19 +1908,15 @@ void IOPlacer::addPinGroup(PinList* group, bool order) pin_names += pin->getName() + " "; pin_cnt++; if (pin_cnt >= pins_per_report_ - && !logger_->debugCheck(utl::PPL, "report_pin_names", 1)) { + && !logger_->debugCheck(utl::PPL, "pin_groups", 1)) { pin_names += "... "; break; } } - if (logger_->debugCheck(utl::PPL, "report_pin_names", 1)) { - debugPrint(logger_, - utl::PPL, - "report_pin_names", - 1, - "Pin group: [ {}]", - pin_names); + if (logger_->debugCheck(utl::PPL, "pin_groups", 1)) { + debugPrint( + logger_, utl::PPL, "pin_groups", 1, "Pin group: [ {}]", pin_names); } else { logger_->info(utl::PPL, 44, "Pin group: [ {}]", pin_names); } diff --git a/src/ppl/src/IOPlacer.tcl b/src/ppl/src/IOPlacer.tcl index b2855407331..b2f01915dfe 100644 --- a/src/ppl/src/IOPlacer.tcl +++ b/src/ppl/src/IOPlacer.tcl @@ -235,7 +235,6 @@ proc set_io_pin_constraint { args } { } foreach {pin1 pin2} $mirrored_pins { - utl::info PPL 80 "Mirroring pins $pin1 and $pin2." set bterm1 [ppl::parse_pin_names "set_io_pin_constraint -mirrored_pins" $pin1] set bterm2 [ppl::parse_pin_names "set_io_pin_constraint -mirrored_pins" $pin2] ppl::add_mirrored_pins $bterm1 $bterm2 diff --git a/src/ppl/test/add_constraint10.ok b/src/ppl/test/add_constraint10.ok index 63062f9869f..a7ba9114c2b 100644 --- a/src/ppl/test/add_constraint10.ok +++ b/src/ppl/test/add_constraint10.ok @@ -7,10 +7,6 @@ [INFO ODB-0130] Created 54 pins. [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. -[INFO PPL-0080] Mirroring pins resp_msg[0] and req_msg[0]. -[INFO PPL-0080] Mirroring pins resp_msg[1] and req_msg[1]. -[INFO PPL-0080] Mirroring pins resp_msg[2] and req_msg[2]. -[INFO PPL-0080] Mirroring pins resp_msg[3] and req_msg[3]. Found 0 macro blocks. [INFO PPL-0010] Tentative 0 to set up sections. [INFO PPL-0001] Number of slots 2494 diff --git a/src/ppl/test/add_constraint11.ok b/src/ppl/test/add_constraint11.ok index f49a5f2467d..332a9d2c536 100644 --- a/src/ppl/test/add_constraint11.ok +++ b/src/ppl/test/add_constraint11.ok @@ -8,11 +8,6 @@ [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. [INFO PPL-0044] Pin group: [ resp_msg[0] resp_msg[1] clk resp_val resp_rdy ... ] -[INFO PPL-0080] Mirroring pins resp_msg[0] and req_msg[0]. -[INFO PPL-0080] Mirroring pins resp_msg[1] and req_msg[1]. -[INFO PPL-0080] Mirroring pins resp_val and req_val. -[INFO PPL-0080] Mirroring pins resp_rdy and req_rdy. -[INFO PPL-0080] Mirroring pins resp_msg[10] and req_msg[10]. Found 0 macro blocks. [INFO PPL-0010] Tentative 0 to set up sections. [INFO PPL-0001] Number of slots 2494 diff --git a/src/ppl/test/add_constraint12.ok b/src/ppl/test/add_constraint12.ok index b7f6cb15414..7fe778890d2 100644 --- a/src/ppl/test/add_constraint12.ok +++ b/src/ppl/test/add_constraint12.ok @@ -9,10 +9,6 @@ [INFO ODB-0133] Created 54 nets and 88 connections. [INFO PPL-0044] Pin group: [ resp_msg[3] resp_msg[2] resp_msg[14] req_val ] [INFO PPL-0044] Pin group: [ req_rdy req_msg[10] req_msg[11] req_msg[12] req_msg[13] ... ] -[INFO PPL-0080] Mirroring pins resp_msg[3] and req_msg[3]. -[INFO PPL-0080] Mirroring pins resp_msg[2] and req_msg[2]. -[INFO PPL-0080] Mirroring pins resp_msg[14] and req_msg[14]. -[INFO PPL-0080] Mirroring pins req_val and resp_val. Found 0 macro blocks. [INFO PPL-0010] Tentative 0 to set up sections. [INFO PPL-0001] Number of slots 2494 diff --git a/src/ppl/test/add_constraint13.ok b/src/ppl/test/add_constraint13.ok index 9349cad948b..e3ca9ce692f 100644 --- a/src/ppl/test/add_constraint13.ok +++ b/src/ppl/test/add_constraint13.ok @@ -9,8 +9,6 @@ [INFO ODB-0133] Created 54 nets and 88 connections. [INFO PPL-0044] Pin group: [ resp_msg[3] resp_msg[2] resp_msg[14] req_val ] [INFO PPL-0044] Pin group: [ req_rdy req_msg[10] req_msg[11] req_msg[12] req_msg[13] ... ] -[INFO PPL-0080] Mirroring pins resp_msg[3] and req_msg[3]. -[INFO PPL-0080] Mirroring pins resp_msg[2] and req_msg[2]. Found 0 macro blocks. [INFO PPL-0010] Tentative 0 to set up sections. [INFO PPL-0001] Number of slots 2494 diff --git a/src/ppl/test/add_constraint14.ok b/src/ppl/test/add_constraint14.ok index f49a5f2467d..332a9d2c536 100644 --- a/src/ppl/test/add_constraint14.ok +++ b/src/ppl/test/add_constraint14.ok @@ -8,11 +8,6 @@ [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. [INFO PPL-0044] Pin group: [ resp_msg[0] resp_msg[1] clk resp_val resp_rdy ... ] -[INFO PPL-0080] Mirroring pins resp_msg[0] and req_msg[0]. -[INFO PPL-0080] Mirroring pins resp_msg[1] and req_msg[1]. -[INFO PPL-0080] Mirroring pins resp_val and req_val. -[INFO PPL-0080] Mirroring pins resp_rdy and req_rdy. -[INFO PPL-0080] Mirroring pins resp_msg[10] and req_msg[10]. Found 0 macro blocks. [INFO PPL-0010] Tentative 0 to set up sections. [INFO PPL-0001] Number of slots 2494 diff --git a/src/ppl/test/add_constraint15.ok b/src/ppl/test/add_constraint15.ok index f38034c77aa..35f7431d45c 100644 --- a/src/ppl/test/add_constraint15.ok +++ b/src/ppl/test/add_constraint15.ok @@ -8,7 +8,6 @@ [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. [INFO PPL-0044] Pin group: [ req_msg[0] req_msg[1] req_msg[2] req_msg[3] req_msg[4] ... ] -[INFO PPL-0080] Mirroring pins req_msg[0] and req_val. Found 0 macro blocks. [INFO PPL-0010] Tentative 0 to set up sections. [INFO PPL-0001] Number of slots 1008 diff --git a/src/ppl/test/add_constraint9.ok b/src/ppl/test/add_constraint9.ok index 1a47e59f272..bcf3b2a4124 100644 --- a/src/ppl/test/add_constraint9.ok +++ b/src/ppl/test/add_constraint9.ok @@ -7,10 +7,6 @@ [INFO ODB-0130] Created 54 pins. [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. -[INFO PPL-0080] Mirroring pins resp_msg[0] and req_msg[0]. -[INFO PPL-0080] Mirroring pins resp_msg[1] and req_msg[1]. -[INFO PPL-0080] Mirroring pins resp_msg[2] and req_msg[2]. -[INFO PPL-0080] Mirroring pins resp_msg[3] and req_msg[3]. Found 0 macro blocks. [INFO PPL-0010] Tentative 0 to set up sections. [INFO PPL-0001] Number of slots 2494 diff --git a/src/ppl/test/add_constraint_debug.ok b/src/ppl/test/add_constraint_debug.ok index 68e038df0b8..30f59969f01 100644 --- a/src/ppl/test/add_constraint_debug.ok +++ b/src/ppl/test/add_constraint_debug.ok @@ -7,10 +7,10 @@ [INFO ODB-0130] Created 54 pins. [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. -[DEBUG PPL-report_pin_names] Restrict pins [ req_msg[31] req_msg[30] req_msg[29] req_msg[28] req_msg[27] req_msg[26] req_msg[25] req_msg[24] req_msg[23] req_msg[22] req_msg[21] req_msg[20] req_msg[19] req_msg[18] req_msg[17] req_msg[16] req_msg[15] req_msg[14] req_msg[13] req_msg[12] req_msg[11] req_msg[10] req_msg[9] req_msg[8] req_msg[7] req_msg[6] req_msg[5] req_msg[4] req_msg[3] req_msg[2] req_msg[1] req_msg[0] ] to region 0.00u-100.13u at the BOTTOM edge. -[DEBUG PPL-report_pin_names] Pin group: [ req_msg[0] req_msg[1] req_msg[2] req_msg[3] req_msg[4] req_msg[5] req_msg[6] req_msg[7] req_msg[8] req_msg[9] req_msg[10] req_msg[11] req_msg[12] req_msg[13] req_msg[14] req_msg[15] req_msg[16] req_msg[17] req_msg[18] req_msg[19] req_msg[20] req_msg[21] req_msg[22] req_msg[23] req_msg[24] req_msg[25] req_msg[26] req_msg[27] req_msg[28] req_msg[29] req_msg[30] req_msg[31] ] -[DEBUG PPL-report_pin_names] Restrict pins [ resp_msg[15] resp_msg[14] resp_msg[13] resp_msg[12] resp_msg[11] resp_msg[10] resp_msg[9] resp_msg[8] resp_msg[7] resp_msg[6] resp_msg[5] resp_msg[4] resp_msg[3] resp_msg[2] resp_msg[1] resp_msg[0] ] to region 0.00u-100.13u at the BOTTOM edge. -[DEBUG PPL-report_pin_names] Pin group: [ resp_msg[0] resp_msg[1] resp_msg[2] resp_msg[3] resp_msg[4] resp_msg[5] resp_msg[6] resp_msg[7] resp_msg[8] resp_msg[9] resp_msg[10] resp_msg[11] resp_msg[12] resp_msg[13] resp_msg[14] resp_msg[15] ] +[DEBUG PPL-pin_groups] Restrict pins [ req_msg[31] req_msg[30] req_msg[29] req_msg[28] req_msg[27] req_msg[26] req_msg[25] req_msg[24] req_msg[23] req_msg[22] req_msg[21] req_msg[20] req_msg[19] req_msg[18] req_msg[17] req_msg[16] req_msg[15] req_msg[14] req_msg[13] req_msg[12] req_msg[11] req_msg[10] req_msg[9] req_msg[8] req_msg[7] req_msg[6] req_msg[5] req_msg[4] req_msg[3] req_msg[2] req_msg[1] req_msg[0] ] to region 0.00u-100.13u at the BOTTOM edge. +[DEBUG PPL-pin_groups] Pin group: [ req_msg[0] req_msg[1] req_msg[2] req_msg[3] req_msg[4] req_msg[5] req_msg[6] req_msg[7] req_msg[8] req_msg[9] req_msg[10] req_msg[11] req_msg[12] req_msg[13] req_msg[14] req_msg[15] req_msg[16] req_msg[17] req_msg[18] req_msg[19] req_msg[20] req_msg[21] req_msg[22] req_msg[23] req_msg[24] req_msg[25] req_msg[26] req_msg[27] req_msg[28] req_msg[29] req_msg[30] req_msg[31] ] +[DEBUG PPL-pin_groups] Restrict pins [ resp_msg[15] resp_msg[14] resp_msg[13] resp_msg[12] resp_msg[11] resp_msg[10] resp_msg[9] resp_msg[8] resp_msg[7] resp_msg[6] resp_msg[5] resp_msg[4] resp_msg[3] resp_msg[2] resp_msg[1] resp_msg[0] ] to region 0.00u-100.13u at the BOTTOM edge. +[DEBUG PPL-pin_groups] Pin group: [ resp_msg[0] resp_msg[1] resp_msg[2] resp_msg[3] resp_msg[4] resp_msg[5] resp_msg[6] resp_msg[7] resp_msg[8] resp_msg[9] resp_msg[10] resp_msg[11] resp_msg[12] resp_msg[13] resp_msg[14] resp_msg[15] ] Found 0 macro blocks. [INFO PPL-0010] Tentative 0 to set up sections. [INFO PPL-0001] Number of slots 1008 diff --git a/src/ppl/test/add_constraint_debug.tcl b/src/ppl/test/add_constraint_debug.tcl index bfa208065ea..50287596c66 100644 --- a/src/ppl/test/add_constraint_debug.tcl +++ b/src/ppl/test/add_constraint_debug.tcl @@ -3,7 +3,7 @@ source "helpers.tcl" read_lef Nangate45/Nangate45.lef read_def gcd.def -set_debug_level PPL "report_pin_names" 1 +set_debug_level PPL "pin_groups" 1 set_io_pin_constraint -region bottom:* -group -order -pin_names {req_msg[0] req_msg[1] req_msg[2] req_msg[3] req_msg[4] req_msg[5] req_msg[6] req_msg[7] req_msg[8] req_msg[9] req_msg[10] req_msg[11] req_msg[12] req_msg[13] req_msg[14] req_msg[15] req_msg[16] req_msg[17] req_msg[18] req_msg[19] req_msg[20] req_msg[21] req_msg[22] req_msg[23] req_msg[24] req_msg[25] req_msg[26] req_msg[27] req_msg[28] req_msg[29] req_msg[30] req_msg[31]} set_io_pin_constraint -region bottom:* -group -order -pin_names {resp_msg[0] resp_msg[1] resp_msg[2] resp_msg[3] resp_msg[4] resp_msg[5] resp_msg[6] resp_msg[7] resp_msg[8] resp_msg[9] resp_msg[10] resp_msg[11] resp_msg[12] resp_msg[13] resp_msg[14] resp_msg[15]} diff --git a/src/ppl/test/annealing_mirrored1.ok b/src/ppl/test/annealing_mirrored1.ok index 3dc6f401a93..727b0a40663 100644 --- a/src/ppl/test/annealing_mirrored1.ok +++ b/src/ppl/test/annealing_mirrored1.ok @@ -7,17 +7,6 @@ [INFO ODB-0130] Created 54 pins. [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. -[INFO PPL-0080] Mirroring pins resp_msg[0] and req_msg[0]. -[INFO PPL-0080] Mirroring pins resp_msg[1] and req_msg[1]. -[INFO PPL-0080] Mirroring pins resp_msg[2] and req_msg[2]. -[INFO PPL-0080] Mirroring pins resp_msg[3] and req_msg[3]. -[INFO PPL-0080] Mirroring pins resp_msg[4] and req_msg[4]. -[INFO PPL-0080] Mirroring pins resp_msg[5] and req_msg[5]. -[INFO PPL-0080] Mirroring pins resp_msg[6] and req_msg[6]. -[INFO PPL-0080] Mirroring pins resp_msg[7] and req_msg[7]. -[INFO PPL-0080] Mirroring pins resp_msg[8] and req_msg[8]. -[INFO PPL-0080] Mirroring pins resp_msg[9] and req_msg[9]. -[INFO PPL-0080] Mirroring pins resp_msg[10] and req_msg[10]. Found 0 macro blocks. [INFO PPL-0001] Number of slots 2494 [INFO PPL-0002] Number of I/O 54 diff --git a/src/ppl/test/annealing_mirrored2.ok b/src/ppl/test/annealing_mirrored2.ok index 12c4695ffa2..32705362fd3 100644 --- a/src/ppl/test/annealing_mirrored2.ok +++ b/src/ppl/test/annealing_mirrored2.ok @@ -7,17 +7,6 @@ [INFO ODB-0130] Created 54 pins. [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. -[INFO PPL-0080] Mirroring pins resp_msg[0] and req_msg[0]. -[INFO PPL-0080] Mirroring pins resp_msg[1] and req_msg[1]. -[INFO PPL-0080] Mirroring pins resp_msg[2] and req_msg[2]. -[INFO PPL-0080] Mirroring pins resp_msg[3] and req_msg[3]. -[INFO PPL-0080] Mirroring pins resp_msg[4] and req_msg[4]. -[INFO PPL-0080] Mirroring pins resp_msg[5] and req_msg[5]. -[INFO PPL-0080] Mirroring pins resp_msg[6] and req_msg[6]. -[INFO PPL-0080] Mirroring pins resp_msg[7] and req_msg[7]. -[INFO PPL-0080] Mirroring pins resp_msg[8] and req_msg[8]. -[INFO PPL-0080] Mirroring pins resp_msg[9] and req_msg[9]. -[INFO PPL-0080] Mirroring pins resp_msg[10] and req_msg[10]. Found 0 macro blocks. [INFO PPL-0001] Number of slots 2494 [INFO PPL-0002] Number of I/O 54 diff --git a/src/ppl/test/annealing_mirrored3.ok b/src/ppl/test/annealing_mirrored3.ok index 9658f8add12..f3c3535fc40 100644 --- a/src/ppl/test/annealing_mirrored3.ok +++ b/src/ppl/test/annealing_mirrored3.ok @@ -7,17 +7,6 @@ [INFO ODB-0130] Created 54 pins. [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. -[INFO PPL-0080] Mirroring pins resp_msg[0] and req_msg[0]. -[INFO PPL-0080] Mirroring pins resp_msg[1] and req_msg[1]. -[INFO PPL-0080] Mirroring pins resp_msg[2] and req_msg[2]. -[INFO PPL-0080] Mirroring pins resp_msg[3] and req_msg[3]. -[INFO PPL-0080] Mirroring pins resp_msg[4] and req_msg[4]. -[INFO PPL-0080] Mirroring pins resp_msg[5] and req_msg[5]. -[INFO PPL-0080] Mirroring pins resp_msg[6] and req_msg[6]. -[INFO PPL-0080] Mirroring pins resp_msg[7] and req_msg[7]. -[INFO PPL-0080] Mirroring pins resp_msg[8] and req_msg[8]. -[INFO PPL-0080] Mirroring pins resp_msg[9] and req_msg[9]. -[INFO PPL-0080] Mirroring pins resp_msg[10] and req_msg[10]. Found 0 macro blocks. [INFO PPL-0001] Number of slots 2494 [INFO PPL-0002] Number of I/O 54 diff --git a/src/ppl/test/annealing_mirrored4.ok b/src/ppl/test/annealing_mirrored4.ok index 87b2f9301f6..57166091df2 100644 --- a/src/ppl/test/annealing_mirrored4.ok +++ b/src/ppl/test/annealing_mirrored4.ok @@ -8,17 +8,6 @@ [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. [INFO PPL-0044] Pin group: [ req_msg[0] req_msg[1] req_msg[2] req_msg[3] req_msg[4] ... ] -[INFO PPL-0080] Mirroring pins resp_msg[0] and req_msg[0]. -[INFO PPL-0080] Mirroring pins resp_msg[1] and req_msg[1]. -[INFO PPL-0080] Mirroring pins resp_msg[2] and req_msg[2]. -[INFO PPL-0080] Mirroring pins resp_msg[3] and req_msg[3]. -[INFO PPL-0080] Mirroring pins resp_msg[4] and req_msg[4]. -[INFO PPL-0080] Mirroring pins resp_msg[5] and req_msg[5]. -[INFO PPL-0080] Mirroring pins resp_msg[6] and req_msg[6]. -[INFO PPL-0080] Mirroring pins resp_msg[7] and req_msg[7]. -[INFO PPL-0080] Mirroring pins resp_msg[8] and req_msg[8]. -[INFO PPL-0080] Mirroring pins resp_msg[9] and req_msg[9]. -[INFO PPL-0080] Mirroring pins resp_msg[10] and req_msg[10]. Found 0 macro blocks. [INFO PPL-0001] Number of slots 2494 [INFO PPL-0002] Number of I/O 54 diff --git a/src/ppl/test/annealing_mirrored5.ok b/src/ppl/test/annealing_mirrored5.ok index 0d82f79f433..c13c84901fd 100644 --- a/src/ppl/test/annealing_mirrored5.ok +++ b/src/ppl/test/annealing_mirrored5.ok @@ -8,17 +8,6 @@ [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. [INFO PPL-0044] Pin group: [ req_msg[0] req_msg[1] req_msg[2] req_msg[3] req_msg[4] ... ] -[INFO PPL-0080] Mirroring pins resp_msg[0] and req_msg[0]. -[INFO PPL-0080] Mirroring pins resp_msg[1] and req_msg[1]. -[INFO PPL-0080] Mirroring pins resp_msg[2] and req_msg[2]. -[INFO PPL-0080] Mirroring pins resp_msg[3] and req_msg[3]. -[INFO PPL-0080] Mirroring pins resp_msg[4] and req_msg[4]. -[INFO PPL-0080] Mirroring pins resp_msg[5] and req_msg[5]. -[INFO PPL-0080] Mirroring pins resp_msg[6] and req_msg[6]. -[INFO PPL-0080] Mirroring pins resp_msg[7] and req_msg[7]. -[INFO PPL-0080] Mirroring pins resp_msg[8] and req_msg[8]. -[INFO PPL-0080] Mirroring pins resp_msg[9] and req_msg[9]. -[INFO PPL-0080] Mirroring pins resp_msg[10] and req_msg[10]. Found 0 macro blocks. [INFO PPL-0001] Number of slots 2494 [INFO PPL-0002] Number of I/O 54 diff --git a/src/ppl/test/random9.ok b/src/ppl/test/random9.ok index 5c867e36b56..ec4c2d537ab 100644 --- a/src/ppl/test/random9.ok +++ b/src/ppl/test/random9.ok @@ -7,8 +7,6 @@ [INFO ODB-0130] Created 54 pins. [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. -[INFO PPL-0080] Mirroring pins req_msg[14] and resp_msg[14]. -[INFO PPL-0080] Mirroring pins req_msg[15] and resp_msg[15]. Found 0 macro blocks. Using 2 tracks default min distance between IO pins. [INFO PPL-0007] Random pin placement. diff --git a/src/ppl/test/write_pin_placement3.ok b/src/ppl/test/write_pin_placement3.ok index 620db781521..d3494fadd6f 100644 --- a/src/ppl/test/write_pin_placement3.ok +++ b/src/ppl/test/write_pin_placement3.ok @@ -8,17 +8,6 @@ [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. [INFO PPL-0044] Pin group: [ req_msg[0] req_msg[1] req_msg[2] req_msg[3] req_msg[4] ... ] -[INFO PPL-0080] Mirroring pins resp_msg[0] and req_msg[0]. -[INFO PPL-0080] Mirroring pins resp_msg[1] and req_msg[1]. -[INFO PPL-0080] Mirroring pins resp_msg[2] and req_msg[2]. -[INFO PPL-0080] Mirroring pins resp_msg[3] and req_msg[3]. -[INFO PPL-0080] Mirroring pins resp_msg[4] and req_msg[4]. -[INFO PPL-0080] Mirroring pins resp_msg[5] and req_msg[5]. -[INFO PPL-0080] Mirroring pins resp_msg[6] and req_msg[6]. -[INFO PPL-0080] Mirroring pins resp_msg[7] and req_msg[7]. -[INFO PPL-0080] Mirroring pins resp_msg[8] and req_msg[8]. -[INFO PPL-0080] Mirroring pins resp_msg[9] and req_msg[9]. -[INFO PPL-0080] Mirroring pins resp_msg[10] and req_msg[10]. Found 0 macro blocks. [INFO PPL-0001] Number of slots 2494 [INFO PPL-0002] Number of I/O 54 diff --git a/src/ppl/test/write_pin_placement4.ok b/src/ppl/test/write_pin_placement4.ok index 9de4323b5c6..afce4dac3a8 100644 --- a/src/ppl/test/write_pin_placement4.ok +++ b/src/ppl/test/write_pin_placement4.ok @@ -8,16 +8,6 @@ [INFO ODB-0131] Created 88 components and 422 component-terminals. [INFO ODB-0133] Created 54 nets and 88 connections. [INFO PPL-0044] Pin group: [ req_msg[0] req_msg[1] req_msg[2] req_msg[3] req_msg[4] ... ] -[INFO PPL-0080] Mirroring pins resp_msg[1] and req_msg[1]. -[INFO PPL-0080] Mirroring pins resp_msg[2] and req_msg[2]. -[INFO PPL-0080] Mirroring pins resp_msg[3] and req_msg[3]. -[INFO PPL-0080] Mirroring pins resp_msg[4] and req_msg[4]. -[INFO PPL-0080] Mirroring pins resp_msg[5] and req_msg[5]. -[INFO PPL-0080] Mirroring pins resp_msg[6] and req_msg[6]. -[INFO PPL-0080] Mirroring pins resp_msg[7] and req_msg[7]. -[INFO PPL-0080] Mirroring pins resp_msg[8] and req_msg[8]. -[INFO PPL-0080] Mirroring pins resp_msg[9] and req_msg[9]. -[INFO PPL-0080] Mirroring pins resp_msg[10] and req_msg[10]. Found 0 macro blocks. [INFO PPL-0001] Number of slots 2494 [INFO PPL-0002] Number of I/O 54 From 7ec87bc79c49fb2007e6ac5c023aa7b2e97bc6c3 Mon Sep 17 00:00:00 2001 From: Eder Monteiro Date: Mon, 4 Dec 2023 14:42:08 -0300 Subject: [PATCH 02/13] ppl: turn vectors of Core into maps for easy access Signed-off-by: Eder Monteiro --- src/ppl/include/ppl/IOPlacer.h | 1 + src/ppl/src/Core.h | 62 ++++++++++--------- src/ppl/src/IOPlacer.cpp | 107 +++++++++++++++------------------ 3 files changed, 81 insertions(+), 89 deletions(-) diff --git a/src/ppl/include/ppl/IOPlacer.h b/src/ppl/include/ppl/IOPlacer.h index bc38b077e08..26400fd03ea 100644 --- a/src/ppl/include/ppl/IOPlacer.h +++ b/src/ppl/include/ppl/IOPlacer.h @@ -35,6 +35,7 @@ #pragma once +#include #include #include #include diff --git a/src/ppl/src/Core.h b/src/ppl/src/Core.h index afee07813c2..75bfee92ca0 100644 --- a/src/ppl/src/Core.h +++ b/src/ppl/src/Core.h @@ -35,6 +35,8 @@ #pragma once +#include + #include "odb/geom.h" namespace ppl { @@ -47,16 +49,16 @@ class Core public: Core(); Core(const Rect& boundary, - const std::vector& min_dst_pins_x, - const std::vector& min_dst_pins_y, - const std::vector& init_tracks_x, - const std::vector& init_tracks_y, - const std::vector& num_tracks_x, - const std::vector& num_tracks_y, - const std::vector& min_area_x, - const std::vector& min_area_y, - const std::vector& min_width_x, - const std::vector& min_width_y, + const std::map& min_dst_pins_x, + const std::map& min_dst_pins_y, + const std::map& init_tracks_x, + const std::map& init_tracks_y, + const std::map& num_tracks_x, + const std::map& num_tracks_y, + const std::map& min_area_x, + const std::map& min_area_y, + const std::map& min_width_x, + const std::map& min_width_y, const int& database_unit) : boundary_(boundary), min_dst_pins_x_(min_dst_pins_x), @@ -74,32 +76,32 @@ class Core } Rect getBoundary() const { return boundary_; } - std::vector getMinDstPinsX() const { return min_dst_pins_x_; } - std::vector getMinDstPinsY() const { return min_dst_pins_y_; } - std::vector getInitTracksX() const { return init_tracks_x_; } - std::vector getInitTracksY() const { return init_tracks_y_; } - std::vector getNumTracksX() const { return num_tracks_x_; } - std::vector getNumTracksY() const { return num_tracks_y_; } - std::vector getMinAreaX() const { return min_area_x_; } - std::vector getMinAreaY() const { return min_area_y_; } - std::vector getMinWidthX() const { return min_width_x_; } - std::vector getMinWidthY() const { return min_width_y_; } + std::map getMinDstPinsX() const { return min_dst_pins_x_; } + std::map getMinDstPinsY() const { return min_dst_pins_y_; } + std::map getInitTracksX() const { return init_tracks_x_; } + std::map getInitTracksY() const { return init_tracks_y_; } + std::map getNumTracksX() const { return num_tracks_x_; } + std::map getNumTracksY() const { return num_tracks_y_; } + std::map getMinAreaX() const { return min_area_x_; } + std::map getMinAreaY() const { return min_area_y_; } + std::map getMinWidthX() const { return min_width_x_; } + std::map getMinWidthY() const { return min_width_y_; } int getDatabaseUnit() const { return database_unit_; } int getPerimeter() const; odb::Point getMirroredPosition(const odb::Point& position) const; private: Rect boundary_; - std::vector min_dst_pins_x_; - std::vector min_dst_pins_y_; - std::vector init_tracks_x_; - std::vector init_tracks_y_; - std::vector num_tracks_x_; - std::vector num_tracks_y_; - std::vector min_area_x_; - std::vector min_area_y_; - std::vector min_width_x_; - std::vector min_width_y_; + std::map min_dst_pins_x_; + std::map min_dst_pins_y_; + std::map init_tracks_x_; + std::map init_tracks_y_; + std::map num_tracks_x_; + std::map num_tracks_y_; + std::map min_area_x_; + std::map min_area_y_; + std::map min_width_x_; + std::map min_width_y_; int database_unit_; }; diff --git a/src/ppl/src/IOPlacer.cpp b/src/ppl/src/IOPlacer.cpp index a7d3ecf4dab..7e84057c84e 100644 --- a/src/ppl/src/IOPlacer.cpp +++ b/src/ppl/src/IOPlacer.cpp @@ -743,14 +743,12 @@ void IOPlacer::findSlots(const std::set& layers, Edge edge) int max = vertical ? ub_x : ub_y; int offset = parms_->getCornerAvoidance(); - - int i = 0; bool dist_in_tracks = parms_->getMinDistanceInTracks(); for (int layer : layers) { int curr_x, curr_y, start_idx, end_idx; // get the on grid min distance - int tech_min_dst - = vertical ? core_->getMinDstPinsX()[i] : core_->getMinDstPinsY()[i]; + int tech_min_dst = vertical ? core_->getMinDstPinsX()[layer] + : core_->getMinDstPinsY()[layer]; int min_dst_pins = dist_in_tracks ? tech_min_dst * parms_->getMinDistance() @@ -769,17 +767,17 @@ void IOPlacer::findSlots(const std::set& layers, Edge edge) } } - int init_tracks - = vertical ? core_->getInitTracksX()[i] : core_->getInitTracksY()[i]; - int num_tracks - = vertical ? core_->getNumTracksX()[i] : core_->getNumTracksY()[i]; + int init_tracks = vertical ? core_->getInitTracksX()[layer] + : core_->getInitTracksY()[layer]; + int num_tracks = vertical ? core_->getNumTracksX()[layer] + : core_->getNumTracksY()[layer]; float thickness_multiplier = vertical ? parms_->getVerticalThicknessMultiplier() : parms_->getHorizontalThicknessMultiplier(); - int half_width = vertical ? int(ceil(core_->getMinWidthX()[i] / 2.0)) - : int(ceil(core_->getMinWidthY()[i] / 2.0)); + int half_width = vertical ? int(ceil(core_->getMinWidthX()[layer] / 2.0)) + : int(ceil(core_->getMinWidthY()[layer] / 2.0)); half_width *= thickness_multiplier; @@ -822,7 +820,6 @@ void IOPlacer::findSlots(const std::set& layers, Edge edge) : checkBlocked(edge, curr_y, layer); slots_.push_back({blocked, false, Point(curr_x, curr_y), layer, edge}); } - i++; } } @@ -1404,26 +1401,10 @@ void IOPlacer::updatePinArea(IOPin& pin) } if (pin.getLayer() != top_grid_->layer) { - int index = -1; int required_min_area = 0; - int i = 0; - for (int layer : hor_layers_) { - if (layer == pin.getLayer()) { - index = i; - } - i++; - } - - i = 0; - for (int layer : ver_layers_) { - if (layer == pin.getLayer()) { - index = i; - } - i++; - } - - if (index == -1) { + if (hor_layers_.find(pin.getLayer()) == hor_layers_.end() + && ver_layers_.find(pin.getLayer()) == ver_layers_.end()) { logger_->error(PPL, 77, "Layer {} of Pin {} not found.", @@ -1434,12 +1415,12 @@ void IOPlacer::updatePinArea(IOPin& pin) if (pin.getOrientation() == Orientation::north || pin.getOrientation() == Orientation::south) { float thickness_multiplier = parms_->getVerticalThicknessMultiplier(); - int half_width = int(ceil(core_->getMinWidthX()[index] / 2.0)) + int half_width = int(ceil(core_->getMinWidthX()[pin.getLayer()] / 2.0)) * thickness_multiplier; - int height = int( - std::max(2.0 * half_width, - ceil(core_->getMinAreaX()[index] / (2.0 * half_width)))); - required_min_area = core_->getMinAreaX()[index]; + int height = int(std::max( + 2.0 * half_width, + ceil(core_->getMinAreaX()[pin.getLayer()] / (2.0 * half_width)))); + required_min_area = core_->getMinAreaX()[pin.getLayer()]; int ext = 0; if (parms_->getVerticalLength() != -1) { @@ -1466,12 +1447,12 @@ void IOPlacer::updatePinArea(IOPin& pin) if (pin.getOrientation() == Orientation::west || pin.getOrientation() == Orientation::east) { float thickness_multiplier = parms_->getHorizontalThicknessMultiplier(); - int half_width = int(ceil(core_->getMinWidthY()[index] / 2.0)) + int half_width = int(ceil(core_->getMinWidthY()[pin.getLayer()] / 2.0)) * thickness_multiplier; - int height = int( - std::max(2.0 * half_width, - ceil(core_->getMinAreaY()[index] / (2.0 * half_width)))); - required_min_area = core_->getMinAreaY()[index]; + int height = int(std::max( + 2.0 * half_width, + ceil(core_->getMinAreaY()[pin.getLayer()] / (2.0 * half_width)))); + required_min_area = core_->getMinAreaY()[pin.getLayer()]; int ext = 0; if (parms_->getHorizontalLengthExtend() != -1) { @@ -1747,6 +1728,14 @@ void IOPlacer::initConstraints(bool annealing) constraint.pins_per_slots = static_cast(constraint.pin_list.size()) / num_slots; if (constraint.pins_per_slots > 1) { + const Interval& interval = constraint.interval; + int interval_length = std::abs(interval.getEnd() - interval.getBegin()); + bool vertical = interval.getEdge() == Edge::top + || interval.getEdge() == Edge::bottom; + int min_dist = vertical ? core_->getMinDstPinsX()[interval.getLayer()] + : core_->getMinDstPinsY()[interval.getLayer()]; + logger_->report("Available slots: {}", + std::ceil((float) interval_length / min_dist)); logger_->warn(PPL, 110, "Constraint has {} pins, but only {} available slots", @@ -2430,16 +2419,16 @@ void IOPlacer::initCore(const std::set& hor_layer_idxs, Rect boundary = getBlock()->getDieArea(); - std::vector min_spacings_x; - std::vector min_spacings_y; - std::vector init_tracks_x; - std::vector init_tracks_y; - std::vector min_areas_x; - std::vector min_areas_y; - std::vector min_widths_x; - std::vector min_widths_y; - std::vector num_tracks_x; - std::vector num_tracks_y; + std::map min_spacings_x; + std::map min_spacings_y; + std::map init_tracks_x; + std::map init_tracks_y; + std::map min_areas_x; + std::map min_areas_y; + std::map min_widths_x; + std::map min_widths_y; + std::map num_tracks_x; + std::map num_tracks_y; for (int hor_layer_idx : hor_layer_idxs) { int min_spacing_y = 0; @@ -2456,11 +2445,11 @@ void IOPlacer::initCore(const std::set& hor_layer_idxs, min_area_y = hor_layer->getArea() * database_unit * database_unit; min_width_y = hor_layer->getWidth(); - min_spacings_y.push_back(min_spacing_y); - init_tracks_y.push_back(init_track_y); - min_areas_y.push_back(min_area_y); - min_widths_y.push_back(min_width_y); - num_tracks_y.push_back(num_track_y); + min_spacings_y[hor_layer_idx] = min_spacing_y; + init_tracks_y[hor_layer_idx] = init_track_y; + min_areas_y[hor_layer_idx] = min_area_y; + min_widths_y[hor_layer_idx] = min_width_y; + num_tracks_y[hor_layer_idx] = num_track_y; } for (int ver_layer_idx : ver_layer_idxs) { @@ -2478,11 +2467,11 @@ void IOPlacer::initCore(const std::set& hor_layer_idxs, min_area_x = ver_layer->getArea() * database_unit * database_unit; min_width_x = ver_layer->getWidth(); - min_spacings_x.push_back(min_spacing_x); - init_tracks_x.push_back(init_track_x); - min_areas_x.push_back(min_area_x); - min_widths_x.push_back(min_width_x); - num_tracks_x.push_back(num_track_x); + min_spacings_x[ver_layer_idx] = min_spacing_x; + init_tracks_x[ver_layer_idx] = init_track_x; + min_areas_x[ver_layer_idx] = min_area_x; + min_widths_x[ver_layer_idx] = min_width_x; + num_tracks_x[ver_layer_idx] = num_track_x; } *core_ = Core(boundary, From e8d5fc07fafdfb04166fba8204647a6a13e8240b Mon Sep 17 00:00:00 2001 From: Eder Monteiro Date: Mon, 4 Dec 2023 16:03:24 -0300 Subject: [PATCH 03/13] ppl: add suggestion of region increase for failing constraints Signed-off-by: Eder Monteiro --- src/ppl/include/ppl/IOPlacer.h | 1 + src/ppl/src/IOPlacer.cpp | 47 ++++++++++++++++++++++++++-------- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/ppl/include/ppl/IOPlacer.h b/src/ppl/include/ppl/IOPlacer.h index 26400fd03ea..43505200d8d 100644 --- a/src/ppl/include/ppl/IOPlacer.h +++ b/src/ppl/include/ppl/IOPlacer.h @@ -294,6 +294,7 @@ class IOPlacer // router const int num_tracks_offset_ = 15; const int pins_per_report_ = 5; + const int default_min_dist_ = 2; std::vector excluded_intervals_; std::vector constraints_; diff --git a/src/ppl/src/IOPlacer.cpp b/src/ppl/src/IOPlacer.cpp index 7e84057c84e..533280d8be9 100644 --- a/src/ppl/src/IOPlacer.cpp +++ b/src/ppl/src/IOPlacer.cpp @@ -729,7 +729,6 @@ Edge IOPlacer::getMirroredEdge(const Edge& edge) void IOPlacer::findSlots(const std::set& layers, Edge edge) { - const int default_min_dist = 2; Point lb = core_->getBoundary().ll(); Point ub = core_->getBoundary().ur(); @@ -757,7 +756,7 @@ void IOPlacer::findSlots(const std::set& layers, Edge edge) / tech_min_dst); min_dst_pins - = (min_dst_pins == 0) ? default_min_dist * tech_min_dst : min_dst_pins; + = (min_dst_pins == 0) ? default_min_dist_ * tech_min_dst : min_dst_pins; if (offset == -1) { offset = num_tracks_offset_ * tech_min_dst; @@ -1732,15 +1731,41 @@ void IOPlacer::initConstraints(bool annealing) int interval_length = std::abs(interval.getEnd() - interval.getBegin()); bool vertical = interval.getEdge() == Edge::top || interval.getEdge() == Edge::bottom; - int min_dist = vertical ? core_->getMinDstPinsX()[interval.getLayer()] - : core_->getMinDstPinsY()[interval.getLayer()]; - logger_->report("Available slots: {}", - std::ceil((float) interval_length / min_dist)); - logger_->warn(PPL, - 110, - "Constraint has {} pins, but only {} available slots", - constraint.pin_list.size(), - num_slots); + int min_dist = std::numeric_limits::min(); + if (interval.getLayer() != -1) { + min_dist = vertical ? core_->getMinDstPinsX()[interval.getLayer()] + : core_->getMinDstPinsY()[interval.getLayer()]; + } else if (vertical) { + for (int layer_idx : ver_layers_) { + int layer_min_dist = core_->getMinDstPinsX()[layer_idx]; + min_dist = std::max(layer_min_dist, min_dist); + } + } else { + for (int layer_idx : ver_layers_) { + int layer_min_dist = core_->getMinDstPinsX()[layer_idx]; + min_dist = std::max(layer_min_dist, min_dist); + } + } + bool dist_in_tracks = parms_->getMinDistanceInTracks(); + int user_min_dist = parms_->getMinDistance(); + if (dist_in_tracks) { + min_dist *= user_min_dist; + } else if (user_min_dist != 0) { + min_dist = std::ceil(static_cast(user_min_dist) / min_dist) + * min_dist; + } else { + min_dist *= default_min_dist_; + } + int increase + = (constraint.pin_list.size() * min_dist) - interval_length; + logger_->warn( + PPL, + 110, + "Constraint has {} pins, but only {} available slots.\n" + "Increase the region in at least {}um.", + constraint.pin_list.size(), + num_slots, + dbuToMicrons(increase)); constraints_no_slots++; } } else { From 729c52842e250990ac1ad3aa238bd2591d794ea4 Mon Sep 17 00:00:00 2001 From: Eder Monteiro Date: Mon, 4 Dec 2023 16:03:44 -0300 Subject: [PATCH 04/13] ppl: new unit test Signed-off-by: Eder Monteiro --- src/ppl/test/add_constraint_error7.ok | 15 +++++++++++++++ src/ppl/test/add_constraint_error7.tcl | 10 ++++++++++ src/ppl/test/regression_tests.tcl | 1 + 3 files changed, 26 insertions(+) create mode 100644 src/ppl/test/add_constraint_error7.ok create mode 100644 src/ppl/test/add_constraint_error7.tcl diff --git a/src/ppl/test/add_constraint_error7.ok b/src/ppl/test/add_constraint_error7.ok new file mode 100644 index 00000000000..4400ee539bb --- /dev/null +++ b/src/ppl/test/add_constraint_error7.ok @@ -0,0 +1,15 @@ +[INFO ODB-0222] Reading LEF file: Nangate45/Nangate45.lef +[INFO ODB-0223] Created 22 technology layers +[INFO ODB-0224] Created 27 technology vias +[INFO ODB-0225] Created 135 library cells +[INFO ODB-0226] Finished LEF file: Nangate45/Nangate45.lef +[INFO ODB-0128] Design: gcd +[INFO ODB-0130] Created 54 pins. +[INFO ODB-0131] Created 88 components and 422 component-terminals. +[INFO ODB-0133] Created 54 nets and 88 connections. +Found 0 macro blocks. +Using 2 tracks default min distance between IO pins. +[WARNING PPL-0110] Constraint has 54 pins, but only 52 available slots. +Increase the region in at least 0.52um. +[ERROR PPL-0111] 1 constraint(s) does not have available slots for the pins. +PPL-0111 diff --git a/src/ppl/test/add_constraint_error7.tcl b/src/ppl/test/add_constraint_error7.tcl new file mode 100644 index 00000000000..c7ad56923d4 --- /dev/null +++ b/src/ppl/test/add_constraint_error7.tcl @@ -0,0 +1,10 @@ +# gcd_nangate45 IO placement +source "helpers.tcl" +read_lef Nangate45/Nangate45.lef +read_def gcd.def + +set_io_pin_constraint -region top:10-30 -pin_names {*} + +catch {place_pins -hor_layers metal3 -ver_layers metal2} error + +puts $error diff --git a/src/ppl/test/regression_tests.tcl b/src/ppl/test/regression_tests.tcl index 64daa8731dd..dee3581a45d 100644 --- a/src/ppl/test/regression_tests.tcl +++ b/src/ppl/test/regression_tests.tcl @@ -22,6 +22,7 @@ record_tests { add_constraint_error4 add_constraint_error5 add_constraint_error6 + add_constraint_error7 annealing1 annealing2 annealing3 From 838662d002bb51ecdeee9cbed3ed78f6f09e4659 Mon Sep 17 00:00:00 2001 From: Eder Monteiro Date: Mon, 4 Dec 2023 16:13:33 -0300 Subject: [PATCH 05/13] ppl: refactor code Signed-off-by: Eder Monteiro --- src/ppl/include/ppl/IOPlacer.h | 1 + src/ppl/src/IOPlacer.cpp | 56 ++++++++++++++++++++++++++++------ 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/src/ppl/include/ppl/IOPlacer.h b/src/ppl/include/ppl/IOPlacer.h index 43505200d8d..0cd65cd5e60 100644 --- a/src/ppl/include/ppl/IOPlacer.h +++ b/src/ppl/include/ppl/IOPlacer.h @@ -269,6 +269,7 @@ class IOPlacer double dbuToMicrons(int64_t dbu); int micronsToDbu(double microns); Edge getMirroredEdge(const Edge& edge); + int computeRegionIncrease(const Interval& interval, int num_pins); // db functions void populateIOPlacer(const std::set& hor_layer_idx, diff --git a/src/ppl/src/IOPlacer.cpp b/src/ppl/src/IOPlacer.cpp index 533280d8be9..49fa685e64e 100644 --- a/src/ppl/src/IOPlacer.cpp +++ b/src/ppl/src/IOPlacer.cpp @@ -727,6 +727,44 @@ Edge IOPlacer::getMirroredEdge(const Edge& edge) return mirrored_edge; } +int IOPlacer::computeRegionIncrease(const Interval& interval, int num_pins) +{ + bool vertical + = interval.getEdge() == Edge::top || interval.getEdge() == Edge::bottom; + int interval_length = std::abs(interval.getEnd() - interval.getBegin()); + int min_dist = std::numeric_limits::min(); + + if (interval.getLayer() != -1) { + min_dist = vertical ? core_->getMinDstPinsX()[interval.getLayer()] + : core_->getMinDstPinsY()[interval.getLayer()]; + } else if (vertical) { + for (int layer_idx : ver_layers_) { + int layer_min_dist = core_->getMinDstPinsX()[layer_idx]; + min_dist = std::max(layer_min_dist, min_dist); + } + } else { + for (int layer_idx : ver_layers_) { + int layer_min_dist = core_->getMinDstPinsX()[layer_idx]; + min_dist = std::max(layer_min_dist, min_dist); + } + } + + bool dist_in_tracks = parms_->getMinDistanceInTracks(); + int user_min_dist = parms_->getMinDistance(); + if (dist_in_tracks) { + min_dist *= user_min_dist; + } else if (user_min_dist != 0) { + min_dist + = std::ceil(static_cast(user_min_dist) / min_dist) * min_dist; + } else { + min_dist *= default_min_dist_; + } + + int increase = (num_pins * min_dist) - interval_length; + + return increase; +} + void IOPlacer::findSlots(const std::set& layers, Edge edge) { Point lb = core_->getBoundary().ll(); @@ -1728,7 +1766,6 @@ void IOPlacer::initConstraints(bool annealing) = static_cast(constraint.pin_list.size()) / num_slots; if (constraint.pins_per_slots > 1) { const Interval& interval = constraint.interval; - int interval_length = std::abs(interval.getEnd() - interval.getBegin()); bool vertical = interval.getEdge() == Edge::top || interval.getEdge() == Edge::bottom; int min_dist = std::numeric_limits::min(); @@ -1757,15 +1794,14 @@ void IOPlacer::initConstraints(bool annealing) min_dist *= default_min_dist_; } int increase - = (constraint.pin_list.size() * min_dist) - interval_length; - logger_->warn( - PPL, - 110, - "Constraint has {} pins, but only {} available slots.\n" - "Increase the region in at least {}um.", - constraint.pin_list.size(), - num_slots, - dbuToMicrons(increase)); + = computeRegionIncrease(interval, constraint.pin_list.size()); + logger_->warn(PPL, + 110, + "Constraint has {} pins, but only {} available slots.\n" + "Increase the region in at least {}um.", + constraint.pin_list.size(), + num_slots, + dbuToMicrons(increase)); constraints_no_slots++; } } else { From 2b46accd325b6814cd3fd8acbbfc5ef7f5c8ed6c Mon Sep 17 00:00:00 2001 From: Eder Monteiro Date: Mon, 4 Dec 2023 17:02:53 -0300 Subject: [PATCH 06/13] ppl: remove dead code Signed-off-by: Eder Monteiro --- src/ppl/src/IOPlacer.cpp | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/ppl/src/IOPlacer.cpp b/src/ppl/src/IOPlacer.cpp index 49fa685e64e..b8f6480f9b5 100644 --- a/src/ppl/src/IOPlacer.cpp +++ b/src/ppl/src/IOPlacer.cpp @@ -1765,36 +1765,8 @@ void IOPlacer::initConstraints(bool annealing) constraint.pins_per_slots = static_cast(constraint.pin_list.size()) / num_slots; if (constraint.pins_per_slots > 1) { - const Interval& interval = constraint.interval; - bool vertical = interval.getEdge() == Edge::top - || interval.getEdge() == Edge::bottom; - int min_dist = std::numeric_limits::min(); - if (interval.getLayer() != -1) { - min_dist = vertical ? core_->getMinDstPinsX()[interval.getLayer()] - : core_->getMinDstPinsY()[interval.getLayer()]; - } else if (vertical) { - for (int layer_idx : ver_layers_) { - int layer_min_dist = core_->getMinDstPinsX()[layer_idx]; - min_dist = std::max(layer_min_dist, min_dist); - } - } else { - for (int layer_idx : ver_layers_) { - int layer_min_dist = core_->getMinDstPinsX()[layer_idx]; - min_dist = std::max(layer_min_dist, min_dist); - } - } - bool dist_in_tracks = parms_->getMinDistanceInTracks(); - int user_min_dist = parms_->getMinDistance(); - if (dist_in_tracks) { - min_dist *= user_min_dist; - } else if (user_min_dist != 0) { - min_dist = std::ceil(static_cast(user_min_dist) / min_dist) - * min_dist; - } else { - min_dist *= default_min_dist_; - } int increase - = computeRegionIncrease(interval, constraint.pin_list.size()); + = computeRegionIncrease(constraint.interval, constraint.pin_list.size()); logger_->warn(PPL, 110, "Constraint has {} pins, but only {} available slots.\n" From 737ddb82a78ff59d363b3f97938d6e5e61da5d88 Mon Sep 17 00:00:00 2001 From: Eder Monteiro Date: Mon, 4 Dec 2023 17:05:31 -0300 Subject: [PATCH 07/13] ppl: const everywhere Signed-off-by: Eder Monteiro --- src/ppl/include/ppl/IOPlacer.h | 2 +- src/ppl/src/IOPlacer.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ppl/include/ppl/IOPlacer.h b/src/ppl/include/ppl/IOPlacer.h index 0cd65cd5e60..4b41b286ad2 100644 --- a/src/ppl/include/ppl/IOPlacer.h +++ b/src/ppl/include/ppl/IOPlacer.h @@ -269,7 +269,7 @@ class IOPlacer double dbuToMicrons(int64_t dbu); int micronsToDbu(double microns); Edge getMirroredEdge(const Edge& edge); - int computeRegionIncrease(const Interval& interval, int num_pins); + int computeRegionIncrease(const Interval& interval, const int num_pins); // db functions void populateIOPlacer(const std::set& hor_layer_idx, diff --git a/src/ppl/src/IOPlacer.cpp b/src/ppl/src/IOPlacer.cpp index b8f6480f9b5..759ca8ca331 100644 --- a/src/ppl/src/IOPlacer.cpp +++ b/src/ppl/src/IOPlacer.cpp @@ -727,11 +727,11 @@ Edge IOPlacer::getMirroredEdge(const Edge& edge) return mirrored_edge; } -int IOPlacer::computeRegionIncrease(const Interval& interval, int num_pins) +int IOPlacer::computeRegionIncrease(const Interval& interval, const int num_pins) { - bool vertical + const bool vertical = interval.getEdge() == Edge::top || interval.getEdge() == Edge::bottom; - int interval_length = std::abs(interval.getEnd() - interval.getBegin()); + const int interval_length = std::abs(interval.getEnd() - interval.getBegin()); int min_dist = std::numeric_limits::min(); if (interval.getLayer() != -1) { @@ -739,18 +739,18 @@ int IOPlacer::computeRegionIncrease(const Interval& interval, int num_pins) : core_->getMinDstPinsY()[interval.getLayer()]; } else if (vertical) { for (int layer_idx : ver_layers_) { - int layer_min_dist = core_->getMinDstPinsX()[layer_idx]; + const int layer_min_dist = core_->getMinDstPinsX()[layer_idx]; min_dist = std::max(layer_min_dist, min_dist); } } else { for (int layer_idx : ver_layers_) { - int layer_min_dist = core_->getMinDstPinsX()[layer_idx]; + const int layer_min_dist = core_->getMinDstPinsX()[layer_idx]; min_dist = std::max(layer_min_dist, min_dist); } } - bool dist_in_tracks = parms_->getMinDistanceInTracks(); - int user_min_dist = parms_->getMinDistance(); + const bool dist_in_tracks = parms_->getMinDistanceInTracks(); + const int user_min_dist = parms_->getMinDistance(); if (dist_in_tracks) { min_dist *= user_min_dist; } else if (user_min_dist != 0) { @@ -760,7 +760,7 @@ int IOPlacer::computeRegionIncrease(const Interval& interval, int num_pins) min_dist *= default_min_dist_; } - int increase = (num_pins * min_dist) - interval_length; + const int increase = (num_pins * min_dist) - interval_length; return increase; } From 2acbef8208aeb2089978726d7eabb87ee0c8caff Mon Sep 17 00:00:00 2001 From: Eder Monteiro Date: Mon, 4 Dec 2023 17:14:26 -0300 Subject: [PATCH 08/13] ppl: rename variable for clarity Signed-off-by: Eder Monteiro --- src/ppl/src/IOPlacer.cpp | 50 +++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/ppl/src/IOPlacer.cpp b/src/ppl/src/IOPlacer.cpp index 759ca8ca331..e7fcc03ee4e 100644 --- a/src/ppl/src/IOPlacer.cpp +++ b/src/ppl/src/IOPlacer.cpp @@ -727,17 +727,18 @@ Edge IOPlacer::getMirroredEdge(const Edge& edge) return mirrored_edge; } -int IOPlacer::computeRegionIncrease(const Interval& interval, const int num_pins) +int IOPlacer::computeRegionIncrease(const Interval& interval, + const int num_pins) { - const bool vertical + const bool vertical_pin = interval.getEdge() == Edge::top || interval.getEdge() == Edge::bottom; const int interval_length = std::abs(interval.getEnd() - interval.getBegin()); int min_dist = std::numeric_limits::min(); if (interval.getLayer() != -1) { - min_dist = vertical ? core_->getMinDstPinsX()[interval.getLayer()] - : core_->getMinDstPinsY()[interval.getLayer()]; - } else if (vertical) { + min_dist = vertical_pin ? core_->getMinDstPinsX()[interval.getLayer()] + : core_->getMinDstPinsY()[interval.getLayer()]; + } else if (vertical_pin) { for (int layer_idx : ver_layers_) { const int layer_min_dist = core_->getMinDstPinsX()[layer_idx]; min_dist = std::max(layer_min_dist, min_dist); @@ -775,17 +776,17 @@ void IOPlacer::findSlots(const std::set& layers, Edge edge) int ub_x = ub.x(); int ub_y = ub.y(); - bool vertical = (edge == Edge::top || edge == Edge::bottom); - int min = vertical ? lb_x : lb_y; - int max = vertical ? ub_x : ub_y; + bool vertical_pin = (edge == Edge::top || edge == Edge::bottom); + int min = vertical_pin ? lb_x : lb_y; + int max = vertical_pin ? ub_x : ub_y; int offset = parms_->getCornerAvoidance(); bool dist_in_tracks = parms_->getMinDistanceInTracks(); for (int layer : layers) { int curr_x, curr_y, start_idx, end_idx; // get the on grid min distance - int tech_min_dst = vertical ? core_->getMinDstPinsX()[layer] - : core_->getMinDstPinsY()[layer]; + int tech_min_dst = vertical_pin ? core_->getMinDstPinsX()[layer] + : core_->getMinDstPinsY()[layer]; int min_dst_pins = dist_in_tracks ? tech_min_dst * parms_->getMinDistance() @@ -804,17 +805,18 @@ void IOPlacer::findSlots(const std::set& layers, Edge edge) } } - int init_tracks = vertical ? core_->getInitTracksX()[layer] - : core_->getInitTracksY()[layer]; - int num_tracks = vertical ? core_->getNumTracksX()[layer] - : core_->getNumTracksY()[layer]; + int init_tracks = vertical_pin ? core_->getInitTracksX()[layer] + : core_->getInitTracksY()[layer]; + int num_tracks = vertical_pin ? core_->getNumTracksX()[layer] + : core_->getNumTracksY()[layer]; float thickness_multiplier - = vertical ? parms_->getVerticalThicknessMultiplier() - : parms_->getHorizontalThicknessMultiplier(); + = vertical_pin ? parms_->getVerticalThicknessMultiplier() + : parms_->getHorizontalThicknessMultiplier(); - int half_width = vertical ? int(ceil(core_->getMinWidthX()[layer] / 2.0)) - : int(ceil(core_->getMinWidthY()[layer] / 2.0)); + int half_width = vertical_pin + ? int(ceil(core_->getMinWidthX()[layer] / 2.0)) + : int(ceil(core_->getMinWidthY()[layer] / 2.0)); half_width *= thickness_multiplier; @@ -827,7 +829,7 @@ void IOPlacer::findSlots(const std::set& layers, Edge edge) static_cast(floor((max - half_width - init_tracks) / min_dst_pins))) - num_tracks_offset; - if (vertical) { + if (vertical_pin) { curr_x = init_tracks + start_idx * min_dst_pins; curr_y = (edge == Edge::bottom) ? lb_y : ub_y; } else { @@ -839,7 +841,7 @@ void IOPlacer::findSlots(const std::set& layers, Edge edge) for (int i = start_idx; i <= end_idx; ++i) { Point pos(curr_x, curr_y); slots.push_back(pos); - if (vertical) { + if (vertical_pin) { curr_x += min_dst_pins; } else { curr_y += min_dst_pins; @@ -853,8 +855,8 @@ void IOPlacer::findSlots(const std::set& layers, Edge edge) for (const Point& pos : slots) { curr_x = pos.getX(); curr_y = pos.getY(); - bool blocked = vertical ? checkBlocked(edge, curr_x, layer) - : checkBlocked(edge, curr_y, layer); + bool blocked = vertical_pin ? checkBlocked(edge, curr_x, layer) + : checkBlocked(edge, curr_y, layer); slots_.push_back({blocked, false, Point(curr_x, curr_y), layer, edge}); } } @@ -1765,8 +1767,8 @@ void IOPlacer::initConstraints(bool annealing) constraint.pins_per_slots = static_cast(constraint.pin_list.size()) / num_slots; if (constraint.pins_per_slots > 1) { - int increase - = computeRegionIncrease(constraint.interval, constraint.pin_list.size()); + int increase = computeRegionIncrease(constraint.interval, + constraint.pin_list.size()); logger_->warn(PPL, 110, "Constraint has {} pins, but only {} available slots.\n" From 16a2344fc9caa3111f15d243c6bc59debb35cba1 Mon Sep 17 00:00:00 2001 From: Eder Monteiro Date: Mon, 4 Dec 2023 17:19:51 -0300 Subject: [PATCH 09/13] ppl: clang-tidy Signed-off-by: Eder Monteiro --- src/ppl/include/ppl/IOPlacer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ppl/include/ppl/IOPlacer.h b/src/ppl/include/ppl/IOPlacer.h index 4b41b286ad2..356d6fe0a9d 100644 --- a/src/ppl/include/ppl/IOPlacer.h +++ b/src/ppl/include/ppl/IOPlacer.h @@ -269,7 +269,7 @@ class IOPlacer double dbuToMicrons(int64_t dbu); int micronsToDbu(double microns); Edge getMirroredEdge(const Edge& edge); - int computeRegionIncrease(const Interval& interval, const int num_pins); + int computeRegionIncrease(Interval& interval, int num_pins); // db functions void populateIOPlacer(const std::set& hor_layer_idx, From 704ed611654de1d4fe81ce275a6fb9275149a76b Mon Sep 17 00:00:00 2001 From: Eder Monteiro Date: Mon, 4 Dec 2023 17:24:55 -0300 Subject: [PATCH 10/13] ppl: clang-tidy again Signed-off-by: Eder Monteiro --- src/ppl/include/ppl/IOPlacer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ppl/include/ppl/IOPlacer.h b/src/ppl/include/ppl/IOPlacer.h index 356d6fe0a9d..0cd65cd5e60 100644 --- a/src/ppl/include/ppl/IOPlacer.h +++ b/src/ppl/include/ppl/IOPlacer.h @@ -269,7 +269,7 @@ class IOPlacer double dbuToMicrons(int64_t dbu); int micronsToDbu(double microns); Edge getMirroredEdge(const Edge& edge); - int computeRegionIncrease(Interval& interval, int num_pins); + int computeRegionIncrease(const Interval& interval, int num_pins); // db functions void populateIOPlacer(const std::set& hor_layer_idx, From ed2b5377fb35a47a772e47f86553d31234cda3ad Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Wed, 6 Dec 2023 09:41:07 -0800 Subject: [PATCH 11/13] gpl: handle no placeable insts in get_global_placement_uniform_density Just return a density of 1.0 since there is nothing to place. Fixes The-OpenROAD-Project/OpenROAD-flow-scripts#1682 Signed-off-by: Matt Liberty --- src/gpl/src/replace.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gpl/src/replace.cpp b/src/gpl/src/replace.cpp index 95d9bc746c9..b9e5ad31af8 100644 --- a/src/gpl/src/replace.cpp +++ b/src/gpl/src/replace.cpp @@ -482,8 +482,10 @@ void Replace::setUniformTargetDensityMode(bool mode) float Replace::getUniformTargetDensity() { // TODO: update to be compatible with multiple target densities - initNesterovPlace(); - return nbVec_[0]->uniformTargetDensity(); + if (initNesterovPlace()) { + return nbVec_[0]->uniformTargetDensity(); + } + return 1; } void Replace::setInitDensityPenalityFactor(float penaltyFactor) From dd31e6ef35c13fca20feecac484039f958580e15 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Wed, 6 Dec 2023 13:29:24 -0800 Subject: [PATCH 12/13] dpl: correct gridEndY calculation This was causing ng45/be* to fail Signed-off-by: Matt Liberty --- src/dpl/src/Opendp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dpl/src/Opendp.cpp b/src/dpl/src/Opendp.cpp index 2e9504dbf09..850be6fe563 100644 --- a/src/dpl/src/Opendp.cpp +++ b/src/dpl/src/Opendp.cpp @@ -744,7 +744,7 @@ int Opendp::gridEndX(const Cell* cell) const int Opendp::gridEndY(const Cell* cell) const { - return gridEndY(cell->y_, cell); + return gridEndY(cell->y_ + cell->height_, cell); } int Opendp::gridEndY(int y, const Cell* cell) const @@ -752,10 +752,10 @@ int Opendp::gridEndY(int y, const Cell* cell) const if (cell->isHybrid()) { auto grid_info = getGridInfo(cell); const auto& grid_sites = grid_info.getSites(); - return gridY(y + cell->height_, grid_sites).first; + return gridY(y, grid_sites).first; } int row_height = getRowHeight(cell); - return divCeil(y + cell->height_, row_height); + return divCeil(y, row_height); } double Opendp::dbuToMicrons(int64_t dbu) const From 5a460f4b1f42fe858776e43d97d2fddfca421602 Mon Sep 17 00:00:00 2001 From: Matt Liberty Date: Wed, 6 Dec 2023 23:08:18 -0800 Subject: [PATCH 13/13] drt: mark routed nets as 'unordered' (ie order_wires is needed) Fixes #4345 Signed-off-by: Matt Liberty --- src/drt/src/io/io.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/drt/src/io/io.cpp b/src/drt/src/io/io.cpp index 02f374fcf67..c1f19bc1100 100644 --- a/src/drt/src/io/io.cpp +++ b/src/drt/src/io/io.cpp @@ -3204,6 +3204,7 @@ void io::Writer::updateDbConn(odb::dbBlock* block, } } _wire_encoder.end(); + net->setWireOrdered(false); } } }