-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathminimal_main.cpp
42 lines (35 loc) · 1.54 KB
/
minimal_main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "salt/salt.h"
#include "salt/base/eval.h" // for salt::WireLengthEval
int main(int argc, char **argv) {
printlog("================================================================================");
printlog(" SALT (Steiner Shallow-Light Tree) - Gengjie CHEN ");
printlog("================================================================================");
// Parse args
if (argc != 3) {
cerr << "Usage: " << argv[0] << " <net_file> <epsilon>" << endl;
return 1;
}
string netFile(argv[1]);
double eps = atof(argv[2]);
salt::Net net;
net.Read(netFile);
printlog("Run SALT algorithm on net", net.name, "with", net.pins.size(), "pins using epsilon =", eps);
// Run SALT
salt::Tree tree;
salt::SaltBuilder saltB;
saltB.Run(net, tree, eps);
// Report
printlog("Tree topology is as follows:");
cout << tree;
salt::WireLengthEval eval(tree);
printlog("Wire length is", eval.wireLength);
printlog("Max path length is", eval.maxPathLength);
printlog("Avg path length is", eval.avgPathLength);
printlog("Max stretch (shallowness) is", eval.maxStretch);
printlog("Avg stretch is", eval.avgStretch);
tree.Write("SALT");
printlog("================================================================================");
printlog(" Done ... ");
printlog("================================================================================");
return 0;
}