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_STANDARD_CELL_PINS_H_
22 #define SRC_STANDARD_CELL_PINS_H_
23 
24 #include "../entity_system/entity_system.h"
25 #include "../entity_system/vector_property.h"
26 
27 namespace ophidian {
28 namespace standard_cell {
29 
30 
31 enum class pin_directions {
32  NOT_ASSIGNED, INPUT, OUTPUT
33 };
34 
35 class pins {
37 
42 
43 public:
45  virtual ~pins();
46 
47  void name(entity_system::entity pin, std::string name);
48  std::string name(entity_system::entity pin) const {
49  return m_names[m_system.lookup(pin)];
50  }
51  void owner(entity_system::entity pin, entity_system::entity cell);
52  entity_system::entity owner(entity_system::entity pin) const {
53  return m_owners[m_system.lookup(pin)];
54  }
55 
56  void direction(entity_system::entity pin, pin_directions dir);
57  pin_directions direction(entity_system::entity pin) const {
58  return m_directions[m_system.lookup(pin)];
59  }
60 
61 
62  void clock_input(entity_system::entity pin, bool clock);
63  bool clock_input(entity_system::entity pin) const {
64  return m_clock_input[m_system.lookup(pin)];
65  }
66 
67 };
68 
69 } /* namespace standard_cell */
70 } /* namespace ophidian */
71 
72 #endif /* SRC_STANDARD_CELL_PINS_H_ */
entity_system class.
Definition: entity_system.h:40
Definition: pins.h:35
Definition: vector_property.h:160
entity_index lookup(entity e) const
Gets the index of an entity.
Definition: entity_system.h:149