Skip to content

Commit 52d1fc0

Browse files
authored
Merge pull request #9182 from The-OpenROAD-Project-staging/secure-refactor-insert-buffer
odb: Refactored insert buffer code
2 parents 620243b + 85c4e03 commit 52d1fc0

File tree

10 files changed

+302
-264
lines changed

10 files changed

+302
-264
lines changed

src/odb/include/odb/db.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,7 +2239,7 @@ class dbNet : public dbObject
22392239
///
22402240
/// Get the gdn cap of this net to *gndcap, total cap to *totalcap
22412241
///
2242-
void getGndTotalCap(double* gndcap, double* totalcap, double MillerMult);
2242+
void getGndTotalCap(double* gndcap, double* totalcap, double miller_mult);
22432243

22442244
///
22452245
/// merge rsegs before doing exttree
@@ -2314,7 +2314,8 @@ class dbNet : public dbObject
23142314
///
23152315
/// compact internal capnode number'
23162316
///
2317-
void collapseInternalCapNum(FILE* capNodeMap);
2317+
void collapseInternalCapNum(FILE* cap_node_map);
2318+
23182319
///
23192320
/// find max number of cap nodes that are internal
23202321
///
@@ -2615,7 +2616,7 @@ class dbNet : public dbObject
26152616
/// contain an irrelevant load.
26162617
///
26172618
dbInst* insertBufferBeforeLoads(
2618-
std::set<dbObject*>& load_pins,
2619+
const std::set<dbObject*>& load_pins,
26192620
const dbMaster* buffer_master,
26202621
const Point* loc = nullptr,
26212622
const char* new_buf_base_name = kDefaultBufBaseName,
@@ -2627,7 +2628,7 @@ class dbNet : public dbObject
26272628
/// Partial-loads buffering with vector load_pins support.
26282629
///
26292630
dbInst* insertBufferBeforeLoads(
2630-
std::vector<dbObject*>& load_pins,
2631+
const std::vector<dbObject*>& load_pins,
26312632
const dbMaster* buffer_master,
26322633
const Point* loc = nullptr,
26332634
const char* new_buf_base_name = kDefaultBufBaseName,
@@ -4200,7 +4201,7 @@ class dbCapNode : public dbObject
42004201

42014202
/// Add the gndCap to *gndcap and *totalcap, ccCap to *totalcap
42024203
///
4203-
void addGndTotalCap(double* gndcap, double* totalcap, double MillerMult);
4204+
void addGndTotalCap(double* gndcap, double* totalcap, double miller_mult);
42044205

42054206
///
42064207
/// Get the gndCap of this capnode to *gndcap and *totalcap
@@ -4210,12 +4211,12 @@ class dbCapNode : public dbObject
42104211
///
42114212
/// Get the gndCap to *gndcap and *totalcap, ccCap to *totalcap
42124213
///
4213-
void getGndTotalCap(double* gndcap, double* totalcap, double MillerMult);
4214+
void getGndTotalCap(double* gndcap, double* totalcap, double miller_mult);
42144215

42154216
///
42164217
/// Add the caps of all corners of CC's from this capnode to *totalcap
42174218
///
4218-
void accAllCcCap(double* totalcap, double MillerMult);
4219+
void accAllCcCap(double* totalcap, double miller_mult);
42194220

42204221
///
42214222
/// Set the capacitance of this CapNode segment for this process corner. Value
@@ -4488,12 +4489,12 @@ class dbRSeg : public dbObject
44884489
///
44894490
/// Get the gdn cap of this RC segment to *gndcap, total cap to *totalcap
44904491
///
4491-
void getGndTotalCap(double* gndcap, double* totalcap, double MillerMult);
4492+
void getGndTotalCap(double* gndcap, double* totalcap, double miller_mult);
44924493

44934494
///
44944495
/// Add the gdn cap of this RC segment to *gndcap, total cap to *totalcap
44954496
///
4496-
void addGndTotalCap(double* gndcap, double* totalcap, double MillerMult);
4497+
void addGndTotalCap(double* gndcap, double* totalcap, double miller_mult);
44974498

44984499
///
44994500
/// do merge rsegs
@@ -4545,7 +4546,7 @@ class dbRSeg : public dbObject
45454546
/// for this process corner, if foreign,
45464547
/// plus coupling capacitance. Returns value in FF.
45474548
///
4548-
double getCapacitance(int corner, double MillerMult);
4549+
double getCapacitance(int corner, double miller_mult);
45494550

45504551
///
45514552
/// Get the CC segs of this RC segment,
@@ -4736,7 +4737,7 @@ class dbCCSeg : public dbObject
47364737
///
47374738
/// Add the capacitance of all corners of this CC segment to *ttcap
47384739
///
4739-
void accAllCcCap(double* ttcap, double MillerMult);
4740+
void accAllCcCap(double* ttcap, double miller_mult);
47404741

47414742
///
47424743
/// Get the capacitance of all corners of this CC segment to *ttcap
@@ -8653,7 +8654,7 @@ class dbModule : public dbObject
86538654
// module.
86548655
void addInst(dbInst* inst);
86558656

8656-
dbBlock* getOwner();
8657+
dbBlock* getOwner() const;
86578658

86588659
dbSet<dbModInst> getChildren() const;
86598660
dbSet<dbModInst> getModInsts() const;
@@ -8665,9 +8666,9 @@ class dbModule : public dbObject
86658666
dbModBTerm* getModBTerm(uint32_t id);
86668667
dbSet<dbInst> getInsts() const;
86678668

8668-
dbModInst* findModInst(const char* name);
8669-
dbInst* findDbInst(const char* name);
8670-
dbModBTerm* findModBTerm(const char* name);
8669+
dbModInst* findModInst(const char* name) const;
8670+
dbInst* findDbInst(const char* name) const;
8671+
dbModBTerm* findModBTerm(const char* name) const;
86718672

86728673
std::vector<dbInst*> getLeafInsts();
86738674

src/odb/src/db/dbCCSeg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ double dbCCSeg::getCapacitance(int corner)
113113
return (*block->cc_val_tbl_)[((seg->getOID() - 1) * cornerCnt) + 1 + corner];
114114
}
115115

116-
void dbCCSeg::accAllCcCap(double* ttcap, double MillerMult)
116+
void dbCCSeg::accAllCcCap(double* ttcap, double miller_mult)
117117
{
118118
_dbCCSeg* seg = (_dbCCSeg*) this;
119119
_dbBlock* block = (_dbBlock*) seg->getOwner();
120120
uint32_t cornerCnt = block->corners_per_block_;
121121
for (uint32_t ii = 0; ii < cornerCnt; ii++) {
122122
ttcap[ii]
123123
+= ((*block->cc_val_tbl_)[((seg->getOID() - 1) * cornerCnt) + 1 + ii])
124-
* MillerMult;
124+
* miller_mult;
125125
}
126126
}
127127

src/odb/src/db/dbCapNode.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,30 +261,30 @@ void dbCapNode::addGndCap(double* gndcap, double* totalcap)
261261
}
262262
}
263263

264-
void dbCapNode::accAllCcCap(double* totalcap, double MillerMult)
264+
void dbCapNode::accAllCcCap(double* totalcap, double miller_mult)
265265
{
266-
if (totalcap == nullptr || MillerMult == 0) {
266+
if (totalcap == nullptr || miller_mult == 0) {
267267
return;
268268
}
269269
for (dbCCSeg* cc : getCCSegs()) {
270-
cc->accAllCcCap(totalcap, MillerMult);
270+
cc->accAllCcCap(totalcap, miller_mult);
271271
}
272272
}
273273

274274
void dbCapNode::getGndTotalCap(double* gndcap,
275275
double* totalcap,
276-
double MillerMult)
276+
double miller_mult)
277277
{
278278
getGndCap(gndcap, totalcap);
279-
accAllCcCap(totalcap, MillerMult);
279+
accAllCcCap(totalcap, miller_mult);
280280
}
281281

282282
void dbCapNode::addGndTotalCap(double* gndcap,
283283
double* totalcap,
284-
double MillerMult)
284+
double miller_mult)
285285
{
286286
addGndCap(gndcap, totalcap);
287-
accAllCcCap(totalcap, MillerMult);
287+
accAllCcCap(totalcap, miller_mult);
288288
}
289289

290290
void dbCapNode::getCapTable(double* cap)

0 commit comments

Comments
 (0)