Skip to content

Commit bfc357d

Browse files
author
shypark98
committed
update params
Signed-off-by: shypark98 <[email protected]>
1 parent b7601ce commit bfc357d

File tree

2 files changed

+39
-27
lines changed

2 files changed

+39
-27
lines changed

src/par/include/par/PartitionMgr.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ class PartitionMgr
265265
int& numSeq);
266266
void getFromSTA(int& Dmax, int& MDmax);
267267
void BuildTimingPath(int& Dmax, int& MDmax);
268-
void getFromPAR(float& Rratio, float& p, float& q);
269-
void getRents(float& Rratio, float& p, float& q);
268+
void getFromPAR(float& Rratio, float& p, float& q, float& avgK);
269+
void getRents(float& Rratio, float& p, float& q, float& avgK);
270270
std::tuple<double, double, double> fitRent(const double* x,
271271
const double* y,
272272
int n);
@@ -287,19 +287,19 @@ class PartitionMgr
287287
void Partitioning(const std::shared_ptr<TritonPart>& triton_part,
288288
const std::shared_ptr<Cluster>& cluster,
289289
SharedClusterVector& resultCV);
290-
void writeFile(
291-
const std::map<std::string, MasterInfo>& onlyUseMasters,
292-
const std::string& top_name,
293-
int numInsts,
294-
int numPIs,
295-
int numPOs,
296-
int numSeq,
297-
int Dmax,
298-
int MDmax,
299-
float Rratio,
300-
float p,
301-
float q,
302-
const char* fileName);
290+
void writeFile(const std::map<std::string, MasterInfo>& onlyUseMasters,
291+
const std::string& top_name,
292+
int numInsts,
293+
int numPIs,
294+
int numPOs,
295+
int numSeq,
296+
int Dmax,
297+
int MDmax,
298+
float Rratio,
299+
float p,
300+
float q,
301+
float avgK,
302+
const char* fileName);
303303

304304
odb::dbDatabase* db_ = nullptr;
305305
sta::dbNetwork* db_network_ = nullptr;

src/par/src/ArtNetSpec.cpp

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,13 @@ void PartitionMgr::writeArtNetSpec(const char* fileName)
8888
float Rratio;
8989
float p;
9090
float q;
91+
float avgK;
9192

9293
getFromODB(onlyUseMasters, top_name, numInsts, numPIs, numPOs, numSeq);
9394
logger_->report("getFromODB done");
9495
getFromSTA(Dmax, MDmax);
9596
logger_->report("getFromSTA done");
96-
getFromPAR(Rratio, p, q);
97+
getFromPAR(Rratio, p, q, avgK);
9798
logger_->report("getFromPAR done");
9899
writeFile(onlyUseMasters,
99100
top_name,
@@ -106,16 +107,16 @@ void PartitionMgr::writeArtNetSpec(const char* fileName)
106107
Rratio,
107108
p,
108109
q,
110+
avgK,
109111
fileName);
110112
}
111113

112-
void PartitionMgr::getFromODB(
113-
std::map<std::string, MasterInfo>& onlyUseMasters,
114-
std::string& top_name,
115-
int& numInsts,
116-
int& numPIs,
117-
int& numPOs,
118-
int& numSeq)
114+
void PartitionMgr::getFromODB(std::map<std::string, MasterInfo>& onlyUseMasters,
115+
std::string& top_name,
116+
int& numInsts,
117+
int& numPIs,
118+
int& numPOs,
119+
int& numSeq)
119120
{
120121
auto block = getDbBlock();
121122
odb::dbSet<dbInst> insts = block->getInsts();
@@ -286,12 +287,12 @@ void PartitionMgr::BuildTimingPath(int& Dmax, int& MDmax)
286287
MDmax = mac_max;
287288
}
288289

289-
void PartitionMgr::getFromPAR(float& Rratio, float& p, float& q)
290+
void PartitionMgr::getFromPAR(float& Rratio, float& p, float& q, float& avgK)
290291
{
291-
getRents(Rratio, p, q);
292+
getRents(Rratio, p, q, avgK);
292293
}
293294

294-
void PartitionMgr::getRents(float& Rratio, float& p, float& q)
295+
void PartitionMgr::getRents(float& Rratio, float& p, float& q, float& avgK)
295296
{
296297
auto block = getDbBlock();
297298
ModuleMgr modMgr;
@@ -314,7 +315,7 @@ void PartitionMgr::getRents(float& Rratio, float& p, float& q)
314315
++id;
315316
}
316317

317-
double avgK = totPins / block->getInsts().size();
318+
avgK = totPins / block->getInsts().size();
318319
bool flag = true;
319320
while (flag) {
320321
flag = partitionCluster(triton_part, modMgr, cv);
@@ -697,6 +698,7 @@ void PartitionMgr::writeFile(
697698
const float Rratio,
698699
const float p,
699700
const float q,
701+
const float avgK,
700702
const char* fileName)
701703
{
702704
std::ofstream outFile(fileName);
@@ -735,6 +737,16 @@ void PartitionMgr::writeFile(
735737
outFile << "O " << numPOs << '\n';
736738
outFile << "END\n";
737739
outFile.close();
740+
logger_->report("#instances: {}", numInsts);
741+
logger_->report("#primary inputs: {}", numPIs);
742+
logger_->report("#primary outputs: {}", numPOs);
743+
logger_->report("Ratio of Region I: {}", Rratio);
744+
logger_->report("Rent's exponent: {}", p);
745+
logger_->report("Average #pins per instances: {}", avgK);
746+
logger_->report("Ratio of #sequential instances to the #instances: {}",
747+
float(numSeq) / numInsts);
748+
logger_->report("Maximum depth of any timing path: {}", Dmax);
749+
logger_->report("Maximum depth of macro path: {}", MDmax);
738750
}
739751

740752
} // namespace par

0 commit comments

Comments
 (0)