Ophidian
 All Classes Namespaces Functions
static_timing_analysis.h
1 /*
2  * Copyright 2016 Ophidian
3 Licensed to the Apache Software Foundation (ASF) under one
4 or more contributor license agreements. See the NOTICE file
5 distributed with this work for additional information
6 regarding copyright ownership. The ASF licenses this file
7 to you under the Apache License, Version 2.0 (the
8 "License"); you may not use this file except in compliance
9 with the License. You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0
12 
13 Unless required by applicable law or agreed to in writing,
14 software distributed under the License is distributed on an
15 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 KIND, either express or implied. See the License for the
17 specific language governing permissions and limitations
18 under the License.
19  */
20 
21 #ifndef OPHIDIAN_TIMING_STATIC_TIMING_ANALYSIS_H
22 #define OPHIDIAN_TIMING_STATIC_TIMING_ANALYSIS_H
23 
24 #include "generic_sta.h"
25 #include "endpoints.h"
26 
27 
28 namespace ophidian {
29 namespace timing {
30 
31 
32 using TimeType = boost::units::quantity< boost::units::si::time > ;
33 using Cell = entity_system::entity;
34 using Net = entity_system::entity;
35 using Pin = entity_system::entity;
36 
37 
38 
40 {
41  const timing::graph * m_timing_graph;
43  const library * m_late_lib;
44  const library * m_early_lib;
45  const netlist::netlist * m_netlist;
46  design_constraints m_dc;
47 
48 
49  // lazy pointers
50  std::unique_ptr<timing_data> m_late;
51  std::unique_ptr<timing_data> m_early;
52  std::unique_ptr<graph_and_topology> m_topology;
53  std::unique_ptr<generic_sta<effective_capacitance_wire_model, pessimistic> > m_late_sta;
54  std::unique_ptr<generic_sta<effective_capacitance_wire_model, optimistic> > m_early_sta;
55  std::unique_ptr<test_calculator> m_test;
56  endpoints m_endpoints;
57  TimeType m_lwns;
58  TimeType m_ewns;
59  TimeType m_ltns;
60  TimeType m_etns;
61 
62  void init_timing_data();
63  void propagate_ats();
64  void propagate_rts();
65  void update_wns_and_tns();
66  bool has_timing_data() const {
67  assert(m_rc_trees);
68  assert(m_timing_graph);
69  assert(m_late_lib && m_early_lib);
70  assert(m_netlist);
71  return m_late_sta && m_early_sta;
72  }
73 public:
75  void graph(const timing::graph& g);
77  void late_lib(const library& lib);
78  void early_lib(const library& lib);
79  void netlist(const netlist::netlist & netlist);
80  void set_constraints(const design_constraints & dc);
81 
82  void update_timing();
83 
84 
85  TimeType late_wns() const {
86  return m_lwns;
87  }
88  TimeType early_wns() const{
89  return m_ewns;
90  }
91  TimeType late_tns() const {
92  return m_ltns;
93  }
94  TimeType early_tns() const{
95  return m_etns;
96  }
97 
98  TimeType early_rise_slack(Pin p) const {
99  return m_early_sta->rise_slack(p);
100  }
101  TimeType early_fall_slack(Pin p) const {
102  return m_early_sta->fall_slack(p);
103  }
104  TimeType late_rise_slack(Pin p) const {
105  return m_late_sta->rise_slack(p);
106  }
107  TimeType late_fall_slack(Pin p) const {
108  return m_late_sta->fall_slack(p);
109  }
110 
111  TimeType early_rise_arrival(Pin p) const {
112  return m_early_sta->rise_arrival(p);
113  }
114  TimeType early_fall_arrival(Pin p) const {
115  return m_early_sta->fall_arrival(p);
116  }
117  TimeType late_rise_arrival(Pin p) const {
118  return m_late_sta->rise_arrival(p);
119  }
120  TimeType late_fall_arrival(Pin p) const {
121  return m_late_sta->fall_arrival(p);
122  }
123 
124  TimeType early_rise_slew(Pin p) const {
125  return m_early_sta->rise_slew(p);
126  }
127  TimeType early_fall_slew(Pin p) const {
128  return m_early_sta->fall_slew(p);
129  }
130  TimeType late_rise_slew(Pin p) const {
131  return m_late_sta->rise_slew(p);
132  }
133  TimeType late_fall_slew(Pin p) const {
134  return m_late_sta->fall_slew(p);
135  }
136 
137  const endpoints & timing_endpoints() const {
138  return m_endpoints;
139  }
140 
141 };
142 
143 }
144 }
145 
146 
147 #endif // OPHIDIAN_TIMING_STATIC_TIMING_ANALYSIS_H
Definition: endpoints.h:30
Definition: design_constraints.h:63
Definition: static_timing_analysis.h:39
Definition: graph.h:44
Netlist class.
Definition: netlist.h:41
Definition: library.h:44