forked from OpenTimer/OpenTimer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_ccs_parser.cpp
More file actions
58 lines (49 loc) · 2.69 KB
/
test_ccs_parser.cpp
File metadata and controls
58 lines (49 loc) · 2.69 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
#include <iostream>
#include <ot/liberty/celllib.hpp>
int main() {
try {
ot::Celllib lib;
lib.read("test_ccs_minimal.lib");
std::cout << "Library loaded successfully!" << std::endl;
std::cout << "Number of cells: " << lib.cells.size() << std::endl;
std::cout << "Number of normalized driver waveforms: " << lib.normalized_driver_waveforms.size() << std::endl;
// Print details about normalized driver waveforms
for (size_t i = 0; i < lib.normalized_driver_waveforms.size(); i++) {
const auto& wf = lib.normalized_driver_waveforms[i];
std::cout << " Waveform " << i << ": " << wf.driver_waveform_name
<< " (template: " << wf.template_name << ")" << std::endl;
std::cout << " Index1 size: " << wf.index_1.size()
<< ", Index2 size: " << wf.index_2.size()
<< ", Values size: " << wf.values.size() << std::endl;
}
// Check if we can access CCSN stages
for (const auto& [cell_name, cell] : lib.cells) {
std::cout << "Cell: " << cell_name << std::endl;
// Check pins for CCSN stages
for (const auto& [pin_name, pin] : cell.cellpins) {
if (pin.ccsn_stages) {
std::cout << " Pin " << pin_name << " has " << pin.ccsn_stages->size() << " CCSN stages" << std::endl;
for (size_t i = 0; i < pin.ccsn_stages->size(); i++) {
const auto& stage = (*pin.ccsn_stages)[i];
std::cout << " Stage " << i << ":" << std::endl;
std::cout << " DC current tables: " << stage.dc_current.size() << std::endl;
std::cout << " Output voltage fall: " << stage.output_voltage_fall.size() << std::endl;
std::cout << " Output voltage rise: " << stage.output_voltage_rise.size() << std::endl;
std::cout << " Propagated noise high: " << stage.propagated_noise_high.size() << std::endl;
std::cout << " Propagated noise low: " << stage.propagated_noise_low.size() << std::endl;
}
}
// Check timing arcs within pins for CCSN stages
for (const auto& timing : pin.timings) {
if (timing.ccsn_stages) {
std::cout << " Timing arc has " << timing.ccsn_stages->size() << " CCSN stages" << std::endl;
}
}
}
}
} catch (const std::exception& e) {
std::cerr << "Error: " << e.what() << std::endl;
return 1;
}
return 0;
}