Ophidian
 All Classes Namespaces Functions
linear_library.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_PARSING_TAU2014_LINEAR_LIBRARY_H
22 #define OPHIDIAN_PARSING_TAU2014_LINEAR_LIBRARY_H
23 
24 #include <string>
25 #include <unordered_map>
26 #include <vector>
27 #include <limits>
28 
29 namespace ophidian {
30 namespace parsing {
31 namespace tau2014 {
32 
34 {
35 public:
36  struct pin;
37  struct test {
38  int from;
39  int to;
40  std::string setup_or_hold;
41  std::string type;
42  double fall[3];
43  double rise[3];
44  };
45 
46  struct arc {
47  int from;
48  int to;
49  double rise_delay[3];
50  double fall_delay[3];
51  double rise_slew[3];
52  double fall_slew[3];
53  std::string unateness;
54  };
55 
56  struct pin {
57  std::string name;
58  std::string direction;
59  double rise_capacitance{std::numeric_limits<double>::max()};
60  double fall_capacitance{std::numeric_limits<double>::max()};
61  bool clock{false};
62  };
63 
64  struct cell {
65  std::string name;
66  std::vector<pin> input_pins;
67  std::vector<pin> output_pins;
68  std::unordered_map< std::string, std::unordered_map< std::string, arc > > arcs;// (input pin => (output pin => arc) )
69  std::size_t clock_pin_id{std::numeric_limits<std::size_t>::max()};
70  std::size_t data_pin_id{std::numeric_limits<std::size_t>::max()};
71  std::vector<test> setup;
72  std::vector<test> hold;
73  };
74 
75 private:
76  using CellMap = std::unordered_map< std::string, cell >;
77  CellMap m_cells;
78 public:
79  linear_library(const std::string & filename);
80  virtual ~linear_library();
81 
82  const CellMap & cells() const {
83  return m_cells;
84  }
85 };
86 
87 }
88 }
89 }
90 
91 
92 #endif // OPHIDIAN_PARSING_TAU2014_LINEAR_LIBRARY_H
Definition: linear_library.h:33