File size: 925 Bytes
d1be154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
// This program demonstrates the basica usage of OpenTimer C++ API
// to get the critical path information of a simple sequential design.
//
// Design : simple.v
// SDC    : simple.sdc
// Library: osu018_stdcells.lib

#include <ot/timer/timer.hpp>

int main(int argc, char *argv[]) {

  // create a timer object
  ot::Timer timer;
  
  // Read design
  timer.read_celllib("osu018_stdcells.lib", ot::MIN)
       .read_celllib("osu018_stdcells.lib", ot::MAX)
       .read_verilog("simple.v")
       .read_sdc("simple.sdc");

  // get the top-5 worst critical paths
  auto paths = timer.report_timing(5);

  for(size_t i=0; i<paths.size(); ++i) {
    std::cout << "----- Critical Path " << i << " -----\n";
    std::cout << paths[i] << '\n';
  }

  // dump the timing graph to dot format for debugging
  //timer.dump_graph(std::cout);
  timer.dump_at(std::cout);
  timer.dump_power(std::cout);

  return 0;
}