39 #include <unordered_map>
40 #include <unordered_set>
51 class NetlistInternalManager;
68 bool operator==(
const Gate& other)
const;
77 bool operator!=(
const Gate& other)
const;
84 ssize_t get_hash()
const;
105 const std::string& get_name()
const;
112 void set_name(
const std::string&
name);
126 bool has_location()
const;
134 void set_location_x(
i32 x);
142 i32 get_location_x()
const;
150 void set_location_y(
i32 y);
158 i32 get_location_y()
const;
166 void set_location(
const std::pair<i32, i32>& location);
175 std::pair<i32, i32> get_location()
const;
182 Module* get_module()
const;
193 std::vector<Module*> get_modules(
const std::function<
bool(
Module*)>& filter =
nullptr,
bool recursive =
true)
const;
261 bool has_boolean_function(
const std::string&
name)
const;
271 bool has_boolean_function(
const GatePin* pin)
const;
280 std::unordered_map<std::string, BooleanFunction> get_boolean_functions(
bool only_custom_functions =
false)
const;
310 bool mark_vcc_gate();
317 bool mark_gnd_gate();
324 bool unmark_vcc_gate();
331 bool unmark_gnd_gate();
338 bool is_vcc_gate()
const;
345 bool is_gnd_gate()
const;
356 const std::vector<Net*>& get_fan_in_nets()
const;
365 std::vector<Net*> get_fan_in_nets(
const std::function<
bool(
Net*)>& filter)
const;
373 Net* get_fan_in_net(
const std::string& pin_name)
const;
381 Net* get_fan_in_net(
const GatePin* pin)
const;
389 bool is_fan_in_net(
const Net*
net)
const;
396 const std::vector<Endpoint*>& get_fan_in_endpoints()
const;
405 std::vector<Endpoint*> get_fan_in_endpoints(
const std::function<
bool(
Endpoint*)>& filter)
const;
413 Endpoint* get_fan_in_endpoint(
const std::string& pin_name)
const;
436 const std::vector<Net*>& get_fan_out_nets()
const;
445 std::vector<Net*> get_fan_out_nets(
const std::function<
bool(
Net*)>& filter)
const;
453 Net* get_fan_out_net(
const std::string& pin_name)
const;
461 Net* get_fan_out_net(
const GatePin* pin)
const;
469 bool is_fan_out_net(
const Net*
net)
const;
476 const std::vector<Endpoint*>& get_fan_out_endpoints()
const;
485 std::vector<Endpoint*> get_fan_out_endpoints(
const std::function<
bool(
Endpoint*)>& filter)
const;
493 Endpoint* get_fan_out_endpoint(
const std::string& pin_name)
const;
518 std::vector<Gate*> get_unique_predecessors(
const std::function<
bool(
const GatePin* pin,
Endpoint* ep)>& filter =
nullptr)
const;
527 std::vector<Endpoint*> get_predecessors(
const std::function<
bool(
const GatePin* pin,
Endpoint* ep)>& filter =
nullptr)
const;
536 Endpoint* get_predecessor(
const std::string& pin_name)
const;
554 std::vector<Gate*> get_unique_successors(
const std::function<
bool(
const GatePin* pin,
Endpoint* ep)>& filter =
nullptr)
const;
563 std::vector<Endpoint*> get_successors(
const std::function<
bool(
const GatePin* pin,
Endpoint* ep)>& filter =
nullptr)
const;
572 Endpoint* get_successor(
const std::string& pin_name)
const;
589 Gate& operator=(
const Gate&) =
delete;
619 std::vector<Endpoint*> m_in_endpoints;
620 std::vector<Endpoint*> m_out_endpoints;
621 std::vector<Net*> m_in_nets;
622 std::vector<Net*> m_out_nets;
625 std::unordered_map<std::string, BooleanFunction> m_functions;