Ophidian
 All Classes Namespaces Functions
cells.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_CELLS_H_
22 #define SRC_NETLIST_CELLS_H_
23 
24 #include <vector>
25 #include "../entity_system/entity_system.h"
26 #include "../entity_system/vector_property.h"
27 #include "../standard_cell/standard_cells.h"
28 
29 namespace ophidian {
30 namespace netlist {
31 
32 class cells {
34 
38 public:
40  virtual ~cells();
41 
42  std::string name(entity_system::entity cell) const {
43  return m_names[m_system.lookup(cell)];
44  }
45  entity_system::entity standard_cell(entity_system::entity cell) const {
46  return m_standard_cells[m_system.lookup(cell)];
47  }
48  const std::vector<entity_system::entity> & pins(entity_system::entity cell) const {
49  return m_pins[m_system.lookup(cell)];
50  }
51 
52  std::pair< std::vector<std::string>::const_iterator, std::vector<std::string>::const_iterator > names() const {
53  return std::make_pair(m_names.begin(), m_names.end());
54  }
55 
56  std::pair< std::vector<entity_system::entity>::const_iterator, std::vector<entity_system::entity>::const_iterator > standard_cells() const {
57  return std::make_pair(m_standard_cells.begin(), m_standard_cells.end());
58  }
59 
60  std::pair< std::vector<std::vector<entity_system::entity>>::const_iterator, std::vector<std::vector<entity_system::entity>>::const_iterator > pins() const {
61  return std::make_pair(m_pins.begin(), m_pins.end());
62  }
63 
64  void insert_pin(entity_system::entity cell, entity_system::entity pin);
65  void pins(entity_system::entity cell, std::vector<entity_system::entity> pins);
66  void name(entity_system::entity cell, std::string name);
67  void standard_cell(entity_system::entity cell, entity_system::entity std_cell);
68 
69 
70  void pins_preallocate(entity_system::entity cell, std::size_t pin_count);
71 
72 };
73 
74 } /* namespace netlist */
75 } /* namespace ophidian */
76 
77 #endif /* SRC_NETLIST_CELLS_H_ */
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
Definition: cells.h:32
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