forked from OpenTimer/OpenTimer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paths27.cpp
More file actions
92 lines (58 loc) · 1.89 KB
/
Copy paths27.cpp
File metadata and controls
92 lines (58 loc) · 1.89 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// This program demonstrates the basica usage of OpenTimer API
// to modify a design and report the timing.
#include <ot/timer/timer.hpp>
int main(int argc, char *argv[]) {
ot::Timer timer;
// Read design
timer.num_threads(std::thread::hardware_concurrency())
.celllib("s27_Early.lib", ot::EARLY)
.celllib("s27_Late.lib", ot::LATE)
.verilog("s27.v")
.spef("s27.spef")
.sdc("s27.sdc");
// Report the TNS and WNS
if(auto tns = timer.tns(); tns) {
std::cout << "TNS: " << *tns << '\n';
}
else {
std::cout << "TNS is not available\n";
}
if(auto wns = timer.wns(); wns) {
std::cout << "WNS: " << *wns << '\n';
}
else {
std::cout << "WNS is not available\n";
}
// apply design modifiers
timer.repower_gate("inst_10", "INV_X16")
.insert_gate("TAUGATE_1", "BUF_X2")
.insert_net("TAUNET_1")
.disconnect_pin("inst_3:ZN")
.connect_pin("inst_3:ZN", "TAUNET_1")
.connect_pin("TAUGATE_1:A", "TAUNET_1")
.connect_pin("TAUGATE_1:Z", "net_14")
.spef("change_1.spef");
// report the slack
std::cout << "Late/Fall slack at pin G17: "
<< *timer.slack("G17", ot::LATE, ot::FALL)
<< '\n';
// report the arrival time
std::cout << "Late/Fall arrival time at pin G17: "
<< *timer.at("G17", ot::LATE, ot::FALL)
<< '\n';
// report the required arrival time
std::cout << "Late/Fall required arrival time at pin G17: "
<< *timer.rat("G17", ot::LATE, ot::FALL)
<< '\n';
// Dump the timer
std::cout << timer.dump_timer();
// Dump the slack
std::cout << timer.dump_slack();
// change from pico seconds to nano seconds
timer.time_unit(ot::nanoseconds(1))
.capacitance_unit(ot::picofarads(1))
.update_timing();
// Dump the slack
std::cout << timer.dump_slack();
return 0;
}