forked from OpenTimer/OpenTimer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_standard_lib.cpp
More file actions
32 lines (26 loc) · 915 Bytes
/
test_standard_lib.cpp
File metadata and controls
32 lines (26 loc) · 915 Bytes
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
#include <iostream>
#include <ot/liberty/celllib.hpp>
int main(int argc, char** argv) {
if (argc < 2) {
std::cerr << "Usage: " << argv[0] << " <lib_file>" << std::endl;
return 1;
}
try {
ot::Celllib lib;
lib.read(argv[1]);
std::cout << "SUCCESS: Library parsed without errors" << std::endl;
std::cout << "Cells: " << lib.cells.size() << std::endl;
// Count timing arcs
size_t total_timings = 0;
for (const auto& [cell_name, cell] : lib.cells) {
for (const auto& [pin_name, pin] : cell.cellpins) {
total_timings += pin.timings.size();
}
}
std::cout << "Total timing arcs: " << total_timings << std::endl;
} catch (const std::exception& e) {
std::cerr << "ERROR: " << e.what() << std::endl;
return 1;
}
return 0;
}