3232#include " sta/Units.hh"
3333#include " stt/SteinerTreeBuilder.h"
3434#include " tcl.h"
35- #include " tst/fixture .h"
35+ #include " tst/nangate45_fixture .h"
3636#include " utl/CallBackHandler.h"
3737#include " utl/Logger.h"
3838#include " utl/deleter.h"
@@ -41,7 +41,7 @@ namespace rsz {
4141
4242static const std::string prefix (" _main/src/rsz/test/" );
4343
44- class BufRemTest : public tst ::Fixture
44+ class BufRemTest : public tst ::Nangate45Fixture
4545{
4646 protected:
4747 BufRemTest ()
@@ -59,38 +59,29 @@ class BufRemTest : public tst::Fixture
5959 &dp_),
6060 ep_ (&logger_, &callback_handler_, db_.get(), sta_.get(), &stt_, &grt_),
6161 resizer_ (&logger_, db_.get(), sta_.get(), &stt_, &grt_, &dp_, &ep_)
62- {
63- }
64-
65- void SetUp () override
6662 {
6763 library_ = readLiberty (prefix + " Nangate45/Nangate45_typ.lib" );
68- loadTechAndLib (" tech" , " Nangate45" , prefix + " Nangate45/Nangate45.lef" );
69-
7064 db_network_ = sta_->getDbNetwork ();
71-
72- // create a chain consisting of 4 buffers
73- odb::dbChip* chip = odb::dbChip::create (db_.get (), db_->getTech ());
74- odb::dbBlock* block = odb::dbBlock::create (chip, " top" );
75- db_network_->setBlock (block);
76- block->setDieArea (odb::Rect (0 , 0 , 1000 , 1000 ));
65+ db_network_->setBlock (block_);
66+ block_->setDieArea (odb::Rect (0 , 0 , 1000 , 1000 ));
7767 // register proper callbacks for timer like read_def
78- sta_->postReadDef (block );
68+ sta_->postReadDef (block_ );
7969
70+ // create a chain consisting of 4 buffers
8071 const char * layer = " metal1" ;
8172
82- makeBTerm (block ,
73+ makeBTerm (block_ ,
8374 " in1" ,
8475 {.bpins = {{.layer_name = layer, .rect = {0 , 0 , 10 , 10 }}}});
8576
8677 odb::dbBTerm* outPort = makeBTerm (
87- block ,
78+ block_ ,
8879 " out1" ,
8980 {.io_type = odb::dbIoType::OUTPUT,
9081 .bpins = {{.layer_name = layer, .rect = {990 , 990 , 1000 , 1000 }}}});
9182
9283 makeBTerm (
93- block ,
84+ block_ ,
9485 " out2" ,
9586 {.io_type = odb::dbIoType::OUTPUT,
9687 .bpins = {{.layer_name = layer, .rect = {980 , 980 , 1000 , 990 }}}});
@@ -102,7 +93,7 @@ class BufRemTest : public tst::Fixture
10293 const char * out_net) {
10394 odb::dbMaster* master = db_->findMaster (master_name);
10495 return tst::Fixture::makeInst (
105- block ,
96+ block_ ,
10697 master,
10798 inst_name,
10899 {.location = location,
@@ -148,9 +139,6 @@ TEST_F(BufRemTest, SlackImproves)
148139 = sta_->vertexArrival (outVertex_, sta::RiseFall::rise (), pathAnalysisPt_);
149140
150141 // Remove buffers 'b2' and 'b3' from the buffer chain
151- odb::dbChip* chip = db_->getChip ();
152- odb::dbBlock* block = chip->getBlock ();
153-
154142 resizer_.initBlock ();
155143 db_->setLogger (&logger_);
156144
@@ -161,11 +149,11 @@ TEST_F(BufRemTest, SlackImproves)
161149 resizer_.logger ()->setDebugLevel (utl::RSZ, " journal" , 1 );
162150
163151 auto insts = std::make_unique<sta::InstanceSeq>();
164- odb::dbInst* inst1 = block ->findInst (" b2" );
152+ odb::dbInst* inst1 = block_ ->findInst (" b2" );
165153 sta::Instance* sta_inst1 = db_network_->dbToSta (inst1);
166154 insts->emplace_back (sta_inst1);
167155
168- odb::dbInst* inst2 = block ->findInst (" b3" );
156+ odb::dbInst* inst2 = block_ ->findInst (" b3" );
169157 sta::Instance* sta_inst2 = db_network_->dbToSta (inst2);
170158 insts->emplace_back (sta_inst2);
171159
0 commit comments