Ophidian
 All Classes Namespaces Functions
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 SRC_PLACEMENT_LIBRARY_H_
22 #define SRC_PLACEMENT_LIBRARY_H_
23 
24 #include "../entity_system/property.h"
25 #include "../entity_system/vector_property.h"
26 #include "../standard_cell/standard_cells.h"
27 #include "../geometry/geometry.h"
28 #include <boost/bimap.hpp>
29 #include <vector>
30 
31 namespace ophidian {
32 namespace placement {
33 
34 class library_pins {
35 
36 };
37 
39 
42 class library {
43 
44  using point = geometry::point<double>;
45  using polygon = geometry::polygon<point>;
46  using multipolygon = geometry::multi_polygon<polygon>;
47 
51 
52  int32_t m_dist2microns;
53 
54 public:
56 
61  virtual ~library();
62 
64 
69  multipolygon geometry(entity_system::entity cell) const {
70  return m_cell_geometry[m_std_cells.cell_system().lookup(cell)];
71  }
73 
78  void geometry(entity_system::entity cell, multipolygon geometry);
79 
80 
81  entity_system::entity cell_create(std::string name);
82 
84 
88  int32_t dist2microns() const {
89  return m_dist2microns;
90  }
91 
92  // pins
94 
99  void pin_offset(entity_system::entity pin, point offset);
101 
106  point pin_offset(entity_system::entity pin) const {
107  return m_pin_offset[m_std_cells.pin_system().lookup(pin)];
108  }
109 
110  entity_system::entity pin_create(entity_system::entity cell, std::string name);
111 
113 
117  void dist2microns(int32_t dist);
118 
119 };
120 
121 } /* namespace placement */
122 } /* namespace ophidian */
123 
124 #endif /* SRC_PLACEMENT_LIBRARY_H_ */
const entity_system::entity_system & pin_system() const
Pin system getter.
Definition: standard_cells.h:179
multipolygon geometry(entity_system::entity cell) const
Cell geometry getter.
Definition: library.h:69
void pin_offset(entity_system::entity pin, point offset)
Pin offset setter.
Definition: library.cpp:47
library(ophidian::standard_cell::standard_cells *std_cells)
Constructor.
Definition: library.cpp:26
Definition: library.h:34
Placement library class.
Definition: library.h:42
int32_t dist2microns() const
Distance unit to microns ratio getter.
Definition: library.h:88
Standard cell class.
Definition: standard_cells.h:37
point pin_offset(entity_system::entity pin) const
Pin offset getter.
Definition: library.h:106
const entity_system::entity_system & cell_system() const
Cell system getter.
Definition: standard_cells.h:114
entity_index lookup(entity e) const
Gets the index of an entity.
Definition: entity_system.h:149