12 Grouping::Grouping(NetlistInternalManager* internal_manager, EventHandler* event_handler,
u32 id, std::string
name)
17 m_internal_manager = internal_manager;
19 m_event_handler = event_handler;
31 log_error(
"grouping",
"grouping name cannot be empty.");
60 int baseCol = (
get_id() - 1) * 37;
61 return utils::Color(baseCol % 255, 200, std::max(250 - baseCol / 255 * 50, 50));
66 return m_internal_manager->m_netlist;
71 return m_internal_manager->grouping_assign_gate(
this, gate, force);
92 std::vector<Gate*> res;
100 for (
Gate* gate : m_gates)
115 std::vector<u32> gate_ids;
119 gate_ids.push_back(gate->get_id());
127 return m_internal_manager->grouping_remove_gate(
this, gate);
153 return m_gates_map.find(gate_id) != m_gates_map.end();
158 return m_internal_manager->grouping_assign_net(
this,
net, force);
179 std::vector<Net*> res;
202 std::vector<u32> net_ids;
206 net_ids.push_back(
net->get_id());
214 return m_internal_manager->grouping_remove_net(
this,
net);
240 return m_nets_map.find(net_id) != m_nets_map.end();
245 return m_internal_manager->grouping_assign_module(
this,
module, force);
266 std::vector<Module*> res;
289 std::vector<u32> module_ids;
301 return m_internal_manager->grouping_remove_module(
this,
module);
327 return m_modules_map.find(module_id) != m_modules_map.end();
NETLIST_API void notify(NetlistEvent::event ev, Netlist *netlist, u32 associated_data=0xFFFFFFFF)
@ color_changed
no associated_data
@ name_changed
no associated_data
std::vector< u32 > get_gate_ids(const std::function< bool(Gate *)> &filter=nullptr) const
const std::vector< Gate * > & get_gates() const
bool remove_gate_by_id(const u32 gate_id)
bool contains_module_by_id(const u32 module_id) const
bool assign_module(Module *module, bool force=false)
bool contains_net_by_id(const u32 net_id) const
std::vector< u32 > get_module_ids(const std::function< bool(Module *)> &filter=nullptr) const
utils::Color get_color() const
bool remove_net(Net *net)
Netlist * get_netlist() const
void set_color(utils::Color c)
bool contains_net(Net *net) const
std::vector< u32 > get_net_ids(const std::function< bool(Net *)> &filter=nullptr) const
bool remove_module_by_id(const u32 module_id)
bool remove_net_by_id(const u32 net_id)
bool assign_gate(Gate *gate, bool force=false)
bool assign_module_by_id(const u32 module_id, bool force=false)
std::string get_name() const
bool remove_gate(Gate *gate)
void set_name(std::string name)
const std::vector< Net * > & get_nets() const
bool contains_module(Module *module) const
const std::vector< Module * > & get_modules() const
bool remove_module(Module *module)
bool contains_gate_by_id(const u32 gate_id) const
bool contains_gate(Gate *gate) const
bool assign_net_by_id(const u32 net_id, bool force=false)
utils::Color next_color()
bool assign_gate_by_id(const u32 gate_id, bool force=false)
bool assign_net(Net *net, bool force=false)
Gate * get_gate_by_id(const u32 gate_id) const
Module * get_module_by_id(u32 module_id) const
Net * get_net_by_id(u32 net_id) const
#define log_error(channel,...)
const Module * module(const Gate *g, const NodeBoxes &boxes)
CORE_API T trim(const T &s, const char *to_remove=" \t\r\n")