Ophidian
 All Classes Namespaces Functions
spef.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 #include "../interconnection/rc_tree.h"
22 
23 #ifndef OPHIDIAN_TIMING_SPEF_H
24 #define OPHIDIAN_TIMING_SPEF_H
25 
26 namespace ophidian {
27 namespace timing {
28 
29 struct spef_tree {
30  std::string net_name;
32  std::string source;
33 };
34 
35 class spef
36 {
37 public:
38  std::vector<spef_tree> m_trees;
39 
40  void tokenize(const std::string & line, std::vector<std::string> & tokens);
41 
42  void skip_header(std::istream &in, std::vector<std::string> & tokens);
43  bool read_net(std::istream &in, std::vector<std::string> & tokens);
44 
45  std::string read_conn(std::istream &in, std::vector<std::string> & tokens, spef_tree & current_tree);
46  void read_cap(std::istream &in, std::vector<std::string> & tokens, spef_tree & current_tree);
47  void read_res(std::istream &in, std::vector<std::string> & tokens, spef_tree & current_tree);
48 
49  bool is_source(const std::vector<std::string> & tokens) const;
50  spef();
51 
52  void read(const std::string & in);
53  void read(std::istream & in);
54 
55  const std::vector<spef_tree> & trees() const {
56  return m_trees;
57  }
58 };
59 
60 }
61 }
62 
63 
64 
65 #endif // OPHIDIAN_TIMING_SPEF_H
Definition: spef.h:29
Definition: spef.h:35
RC Tree Class.
Definition: rc_tree.h:78