@@ -192,10 +192,10 @@ void Restructure::runABC()
192192 " Constants before remap {}" ,
193193 countConsts (block_));
194194
195- Blif blif_ (
195+ Blif blif (
196196 logger_, open_sta_, locell_, loport_, hicell_, hiport_, ++blif_call_id_);
197- blif_ .setReplaceableInstances (path_insts_);
198- blif_ .writeBlif (input_blif_file_name_.c_str (), !is_area_mode_);
197+ blif .setReplaceableInstances (path_insts_);
198+ blif .writeBlif (input_blif_file_name_.c_str (), !is_area_mode_);
199199 debugPrint (
200200 logger_, RMP , " remap" , 1 , " Writing blif file {}" , input_blif_file_name_);
201201 files_to_remove.emplace_back (input_blif_file_name_);
@@ -206,10 +206,10 @@ void Restructure::runABC()
206206
207207 if (is_area_mode_) {
208208 // Area Mode
209- modes = {Mode::AREA_1 , Mode::AREA_2 , Mode::AREA_3 };
209+ modes = {Mode::kArea1 , Mode::kArea2 , Mode::kArea3 };
210210 } else {
211211 // Delay Mode
212- modes = {Mode::DELAY_1 , Mode::DELAY_2 , Mode::DELAY_3 , Mode::DELAY_4 };
212+ modes = {Mode::kDelay1 , Mode::kDelay2 , Mode::kDelay3 , Mode::kDelay4 };
213213 }
214214
215215 child_proc.resize (modes.size (), 0 );
@@ -274,8 +274,7 @@ void Restructure::runABC()
274274 int num_instances = 0 ;
275275 bool success = readAbcLog (abc_log_name, level_gain, delay);
276276 if (success) {
277- success
278- = blif_.inspectBlif (output_blif_file_name_.c_str (), num_instances);
277+ success = blif.inspectBlif (output_blif_file_name_.c_str (), num_instances);
279278 logger_->report (
280279 " Optimized to {} instances in iteration {} with max path depth "
281280 " decrease of {}, delay of {}." ,
@@ -293,7 +292,7 @@ void Restructure::runABC()
293292 } else {
294293 // Using only DELAY_4 for delay based gain since other modes not
295294 // showing good gains
296- if (modes[curr_mode_idx] == Mode::DELAY_4 ) {
295+ if (modes[curr_mode_idx] == Mode::kDelay4 ) {
297296 best_delay_gain = delay;
298297 best_blif = output_blif_file_name_;
299298 }
@@ -307,7 +306,7 @@ void Restructure::runABC()
307306 || best_delay_gain < std::numeric_limits<float >::max ()) {
308307 // read back netlist
309308 debugPrint (logger_, RMP , " remap" , 1 , " Reading blif file {}." , best_blif);
310- blif_ .readBlif (best_blif.c_str (), block_);
309+ blif .readBlif (best_blif.c_str (), block_);
311310 debugPrint (logger_,
312311 utl::RMP ,
313312 " remap" ,
@@ -373,21 +372,21 @@ void Restructure::getEndPoints(sta::PinSet& ends,
373372 if (!errors.empty () && errors[0 ]->size () > 1 ) {
374373 sta::CheckError* error = errors[0 ];
375374 bool first = true ;
376- for (auto pinName : *error) {
377- debugPrint (logger_, RMP , " remap" , 1 , " Unconstrained pin: {}" , pinName );
378- if (!first && open_sta_->getDbNetwork ()->findPin (pinName .c_str ())) {
379- ends.insert (open_sta_->getDbNetwork ()->findPin (pinName .c_str ()));
375+ for (auto pin_name : *error) {
376+ debugPrint (logger_, RMP , " remap" , 1 , " Unconstrained pin: {}" , pin_name );
377+ if (!first && open_sta_->getDbNetwork ()->findPin (pin_name .c_str ())) {
378+ ends.insert (open_sta_->getDbNetwork ()->findPin (pin_name .c_str ()));
380379 }
381380 first = false ;
382381 }
383382 }
384383 if (errors.size () > 1 && errors[1 ]->size () > 1 ) {
385384 sta::CheckError* error = errors[1 ];
386385 bool first = true ;
387- for (auto pinName : *error) {
388- debugPrint (logger_, RMP , " remap" , 1 , " Unclocked pin: {}" , pinName );
389- if (!first && open_sta_->getDbNetwork ()->findPin (pinName .c_str ())) {
390- ends.insert (open_sta_->getDbNetwork ()->findPin (pinName .c_str ()));
386+ for (auto pin_name : *error) {
387+ debugPrint (logger_, RMP , " remap" , 1 , " Unclocked pin: {}" , pin_name );
388+ if (!first && open_sta_->getDbNetwork ()->findPin (pin_name .c_str ())) {
389+ ends.insert (open_sta_->getDbNetwork ()->findPin (pin_name .c_str ()));
391390 }
392391 first = false ;
393392 }
@@ -439,7 +438,7 @@ void Restructure::removeConstCells()
439438
440439 open_sta_->clearLogicConstants ();
441440 open_sta_->findLogicConstants ();
442- std::set<odb::dbInst*> constInsts ;
441+ std::set<odb::dbInst*> const_insts ;
443442 int const_cnt = 1 ;
444443 for (auto inst : block_->getInsts ()) {
445444 int outputs = 0 ;
@@ -462,16 +461,16 @@ void Restructure::removeConstCells()
462461 }
463462 outputs++;
464463 auto pin = open_sta_->getDbNetwork ()->dbToSta (iterm);
465- sta::LogicValue pinVal
464+ sta::LogicValue pin_val
466465 = open_sta_->simLogicValue (pin, open_sta_->cmdMode ());
467- if (pinVal == sta::LogicValue::one || pinVal == sta::LogicValue::zero) {
466+ if (pin_val == sta::LogicValue::one || pin_val == sta::LogicValue::zero) {
468467 odb::dbNet* net = iterm->getNet ();
469468 if (net) {
470- odb::dbMaster* const_master = (pinVal == sta::LogicValue::one)
469+ odb::dbMaster* const_master = (pin_val == sta::LogicValue::one)
471470 ? hicell_master
472471 : locell_master;
473472 odb::dbMTerm* const_port
474- = (pinVal == sta::LogicValue::one) ? hiterm : loterm;
473+ = (pin_val == sta::LogicValue::one) ? hiterm : loterm;
475474 std::string inst_name = " rmp_const_" + std::to_string (const_cnt);
476475 debugPrint (logger_,
477476 RMP ,
@@ -495,19 +494,19 @@ void Restructure::removeConstCells()
495494 }
496495 }
497496 if (outputs > 0 && outputs == const_outputs) {
498- constInsts .insert (inst);
497+ const_insts .insert (inst);
499498 }
500499 }
501500 open_sta_->clearLogicConstants ();
502501
503502 debugPrint (
504- logger_, RMP , " remap" , 2 , " Removing {} instances..." , constInsts .size ());
503+ logger_, RMP , " remap" , 2 , " Removing {} instances..." , const_insts .size ());
505504
506- for (auto inst : constInsts ) {
505+ for (auto inst : const_insts ) {
507506 removeConstCell (inst);
508507 }
509508 logger_->report (" Removed {} instances with constant outputs." ,
510- constInsts .size ());
509+ const_insts .size ());
511510}
512511
513512void Restructure::removeConstCell (odb::dbInst* inst)
@@ -572,19 +571,19 @@ void Restructure::writeOptCommands(std::ofstream& script)
572571 script << choice << ' \n ' ;
573572 script << choice2 << ' \n ' ;
574573
575- if (opt_mode_ == Mode::AREA_3 ) {
574+ if (opt_mode_ == Mode::kArea3 ) {
576575 script << " choice2\n " ; // << "scleanup" << std::endl;
577576 } else {
578577 script << " resyn2\n " ; // << "scleanup" << std::endl;
579578 }
580579
581580 switch (opt_mode_) {
582- case Mode::DELAY_1 : {
581+ case Mode::kDelay1 : {
583582 script << " map -D 0.01 -A 0.9 -B 0.2 -M 0 -p\n " ;
584583 script << " buffer -p -c\n " ;
585584 break ;
586585 }
587- case Mode::DELAY_2 : {
586+ case Mode::kDelay2 : {
588587 script << " choice\n " ;
589588 script << " map -D 0.01 -A 0.9 -B 0.2 -M 0 -p\n " ;
590589 script << " choice\n " ;
@@ -593,7 +592,7 @@ void Restructure::writeOptCommands(std::ofstream& script)
593592 << " topo\n " ;
594593 break ;
595594 }
596- case Mode::DELAY_3 : {
595+ case Mode::kDelay3 : {
597596 script << " choice2\n " ;
598597 script << " map -D 0.01 -A 0.9 -B 0.2 -M 0 -p\n " ;
599598 script << " choice2\n " ;
@@ -602,23 +601,23 @@ void Restructure::writeOptCommands(std::ofstream& script)
602601 << " topo\n " ;
603602 break ;
604603 }
605- case Mode::DELAY_4 : {
604+ case Mode::kDelay4 : {
606605 script << " choice2\n " ;
607606 script << " amap -F 20 -A 20 -C 5000 -Q 0.1 -m\n " ;
608607 script << " choice2\n " ;
609608 script << " map -D 0.01 -A 0.9 -B 0.2 -M 0 -p\n " ;
610609 script << " buffer -p -c\n " ;
611610 break ;
612611 }
613- case Mode::AREA_2 :
614- case Mode::AREA_3 : {
612+ case Mode::kArea2 :
613+ case Mode::kArea3 : {
615614 script << " choice2\n " ;
616615 script << " amap -m -Q 0.1 -F 20 -A 20 -C 5000\n " ;
617616 script << " choice2\n " ;
618617 script << " amap -m -Q 0.1 -F 20 -A 20 -C 5000\n " ;
619618 break ;
620619 }
621- case Mode::AREA_1 :
620+ case Mode::kArea1 :
622621 default : {
623622 script << " choice2\n " ;
624623 script << " amap -m -Q 0.1 -F 20 -A 20 -C 5000\n " ;
@@ -633,27 +632,27 @@ void Restructure::setMode(const char* mode_name)
633632
634633 if (!strcmp (mode_name, " timing" )) {
635634 is_area_mode_ = false ;
636- opt_mode_ = Mode::DELAY_1 ;
635+ opt_mode_ = Mode::kDelay1 ;
637636 } else if (!strcmp (mode_name, " area" )) {
638- opt_mode_ = Mode::AREA_1 ;
637+ opt_mode_ = Mode::kArea1 ;
639638 } else {
640639 logger_->warn (RMP , 10 , " Mode {} not recognized." , mode_name);
641640 }
642641}
643642
644- void Restructure::setTieHiPort (sta::LibertyPort* tieHiPort )
643+ void Restructure::setTieHiPort (sta::LibertyPort* tie_hi_port )
645644{
646- if (tieHiPort ) {
647- hicell_ = tieHiPort ->libertyCell ()->name ();
648- hiport_ = tieHiPort ->name ();
645+ if (tie_hi_port ) {
646+ hicell_ = tie_hi_port ->libertyCell ()->name ();
647+ hiport_ = tie_hi_port ->name ();
649648 }
650649}
651650
652- void Restructure::setTieLoPort (sta::LibertyPort* tieLoPort )
651+ void Restructure::setTieLoPort (sta::LibertyPort* tie_lo_port )
653652{
654- if (tieLoPort ) {
655- locell_ = tieLoPort ->libertyCell ()->name ();
656- loport_ = tieLoPort ->name ();
653+ if (tie_lo_port ) {
654+ locell_ = tie_lo_port ->libertyCell ()->name ();
655+ loport_ = tie_lo_port ->name ();
657656 }
658657}
659658
0 commit comments