Skip to content

Commit 4b5d999

Browse files
authored
Merge pull request #10673 from AcKoucher/rcx-options-refactor
rcx: refactor extraction options setting into its own function
2 parents 1fcfeb8 + 7846f26 commit 4b5d999

4 files changed

Lines changed: 30 additions & 37 deletions

File tree

src/rcx/include/rcx/extRCap.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,6 +1758,7 @@ class extMain
17581758
uint32_t* cornerTable);
17591759

17601760
void setExtractionOptions_v2(ExtractOptions options);
1761+
void setExtractionOptions(const ExtractOptions& options);
17611762
uint32_t makeNetRCsegs_v2(odb::dbNet* net, bool skipStartWarning = false);
17621763
uint32_t resetMapNodes_v2(odb::dbWire* wire);
17631764

@@ -2124,14 +2125,7 @@ class extMain
21242125
void updatePrevControl();
21252126
void getPrevControl();
21262127

2127-
void makeBlockRCsegs(const char* netNames,
2128-
uint32_t cc_up,
2129-
uint32_t ccFlag,
2130-
double resBound,
2131-
bool mergeViaRes,
2132-
double ccThres,
2133-
int contextDepth,
2134-
const char* extRules);
2128+
void makeBlockRCsegs();
21352129

21362130
uint32_t getShortSrcJid(uint32_t jid);
21372131
void make1stRSeg(odb::dbNet* net,
@@ -2723,6 +2717,8 @@ class extMain
27232717
int _ccMaxY;
27242718
double _mergeResBound = 0.0;
27252719
bool _mergeViaRes = false;
2720+
const char* rules_file_path_{nullptr};
2721+
const char* target_nets_names_{nullptr};
27262722
bool _mergeParallelCC = false;
27272723
bool _reportNetNoWire = false;
27282724
int _netNoWireCnt = 0;

src/rcx/src/ext.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,8 @@ void Ext::extract(ExtractOptions options)
230230
if (_ext->_v2) {
231231
_ext->makeBlockRCsegs_v2(options.net, options.ext_model_file);
232232
} else {
233-
_ext->makeBlockRCsegs(options.net,
234-
options.cc_up,
235-
options.cc_model,
236-
options.max_res,
237-
!options.no_merge_via_res,
238-
options.coupling_threshold,
239-
options.context_depth,
240-
options.ext_model_file);
233+
_ext->setExtractionOptions(options);
234+
_ext->makeBlockRCsegs();
241235
}
242236
}
243237

src/rcx/src/extmain.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "rcx/array1.h"
99
#include "rcx/extRCap.h"
1010
#include "rcx/extSpef.h"
11+
#include "rcx/ext_options.h"
1112
#include "utl/Logger.h"
1213

1314
using odb::dbBlock;
@@ -31,6 +32,21 @@ void extMain::init(odb::dbDatabase* db, utl::Logger* logger)
3132
logger_ = logger;
3233
}
3334

35+
void extMain::setExtractionOptions(const ExtractOptions& options)
36+
{
37+
_couplingFlag = options.cc_model;
38+
_coupleThreshold = options.coupling_threshold;
39+
_ccUp = options.cc_up;
40+
_ccContextDepth = options.context_depth;
41+
_mergeViaRes = !options.no_merge_via_res;
42+
_mergeResBound = options.max_res;
43+
_lef_res = options.lef_res;
44+
_lefRC = options.lef_rc;
45+
_dbgOption = options._dbg;
46+
rules_file_path_ = options.ext_model_file;
47+
target_nets_names_ = options.net;
48+
}
49+
3450
void extMain::addDummyCorners(dbBlock* block, uint32_t cnt, utl::Logger* logger)
3551
{
3652
extMain* tmiExt = (extMain*) block->getExtmi();

src/rcx/src/netRC.cpp

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,38 +1800,25 @@ bool extMain::modelExists(const char* extRules)
18001800
return true;
18011801
}
18021802

1803-
void extMain::makeBlockRCsegs(const char* netNames,
1804-
uint32_t cc_up,
1805-
uint32_t ccFlag,
1806-
double resBound,
1807-
bool mergeViaRes,
1808-
double ccThres,
1809-
int contextDepth,
1810-
const char* extRules)
1803+
void extMain::makeBlockRCsegs()
18111804
{
1812-
if (!modelExists(extRules)) {
1805+
if (!modelExists(rules_file_path_)) {
18131806
return;
18141807
}
18151808

18161809
uint32_t debugNetId = 0;
18171810

18181811
_diagFlow = true;
1819-
_couplingFlag = ccFlag;
1820-
_coupleThreshold = ccThres;
18211812
_usingMetalPlanes = true;
1822-
_ccUp = cc_up;
1823-
_couplingFlag = ccFlag;
1824-
_ccContextDepth = contextDepth;
1825-
_mergeViaRes = mergeViaRes;
1826-
_mergeResBound = resBound;
18271813

18281814
if ((_processCornerTable != nullptr)
1829-
|| ((_processCornerTable == nullptr) && (extRules != nullptr))) {
1830-
const char* rulesfile
1831-
= extRules ? extRules : _prevControl->_ruleFileName.c_str();
1815+
|| ((_processCornerTable == nullptr) && (rules_file_path_ != nullptr))) {
1816+
const char* rules_file_path = rules_file_path_
1817+
? rules_file_path_
1818+
: _prevControl->_ruleFileName.c_str();
18321819

18331820
// Reading model file
1834-
if (!setCorners(rulesfile)) {
1821+
if (!setCorners(rules_file_path)) {
18351822
logger_->info(RCX, 128, "skipping Extraction ...");
18361823
return;
18371824
}
@@ -1843,7 +1830,7 @@ void extMain::makeBlockRCsegs(const char* netNames,
18431830
_foreign = false; // extract after read_spef
18441831

18451832
std::vector<dbNet*> inets;
1846-
_allNet = !findSomeNet(_block, netNames, inets, logger_);
1833+
_allNet = !findSomeNet(_block, target_nets_names_, inets, logger_);
18471834
for (auto net : inets) {
18481835
net->setMark(true);
18491836
}

0 commit comments

Comments
 (0)