Ophidian
 All Classes Namespaces Functions
pins.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 SRC_NETLIST_PINS_H_
22 #define SRC_NETLIST_PINS_H_
23 
24 #include <vector>
25 #include "../entity_system/entity_system.h"
26 #include "../entity_system/vector_property.h"
27 
28 namespace ophidian {
29 namespace netlist {
30 
31 class pins {
33 
38 
39 public:
41  virtual ~pins();
42 
43  std::string name(entity_system::entity pin) const {
44  return m_names[m_system.lookup(pin)];
45  }
46  entity_system::entity owner(entity_system::entity pin) const {
47  return m_owners[m_system.lookup(pin)];
48  }
49  entity_system::entity net(entity_system::entity pin) const {
50  return m_nets[m_system.lookup(pin)];
51  }
52  entity_system::entity standard_cell_pin(entity_system::entity pin) const {
53  return m_std_cell_pin[m_system.lookup(pin)];
54  }
55 
56  std::pair< std::vector<entity_system::entity>::const_iterator, std::vector<entity_system::entity>::const_iterator > owners() const {
57  return std::make_pair(m_owners.begin(), m_owners.end());
58  }
59 
60  std::pair< std::vector<entity_system::entity>::const_iterator, std::vector<entity_system::entity>::const_iterator > nets() const {
61  return std::make_pair(m_nets.begin(), m_nets.end());
62  }
63 
64  void name(entity_system::entity pin, std::string name);
65  void owner(entity_system::entity pin, entity_system::entity owner);
66  void net(entity_system::entity pin, entity_system::entity net);
67  void standard_cell_pin(entity_system::entity pin, entity_system::entity std_cell_pin);
68 
69 };
70 
71 } /* namespace netlist */
72 } /* namespace ophidian */
73 
74 #endif /* SRC_NETLIST_PINS_H_ */
Definition: nets.h:32
std::vector< T >::const_iterator begin() const
Begin iterator.
Definition: vector_property.h:137
std::vector< T >::const_iterator end() const
End iterator.
Definition: vector_property.h:146
entity_system class.
Definition: entity_system.h:40
Definition: pins.h:31
entity_index lookup(entity e) const
Gets the index of an entity.
Definition: entity_system.h:149