![]() |
HAL
|
#include <net.h>
Public Member Functions | |
bool | operator== (const Net &other) const |
bool | operator!= (const Net &other) const |
ssize_t | get_hash () const |
u32 | get_id () const |
Netlist * | get_netlist () const |
const std::string & | get_name () const |
void | set_name (const std::string &name) |
Grouping * | get_grouping () const |
Endpoint * | add_source (Gate *gate, const std::string &pin_name) |
Endpoint * | add_source (Gate *gate, GatePin *pin) |
bool | remove_source (Gate *gate, const std::string &pin_name) |
bool | remove_source (Gate *gate, const GatePin *pin) |
bool | remove_source (Endpoint *ep) |
bool | is_a_source (const Gate *gate) const |
bool | is_a_source (const Gate *gate, const std::string &pin_name) const |
bool | is_a_source (const Gate *gate, const GatePin *pin) const |
bool | is_a_source (const Endpoint *ep) const |
u32 | get_num_of_sources (const std::function< bool(Endpoint *ep)> &filter=nullptr) const |
std::vector< Endpoint * > | get_sources (const std::function< bool(Endpoint *ep)> &filter=nullptr) const |
Endpoint * | add_destination (Gate *gate, const std::string &pin_name) |
Endpoint * | add_destination (Gate *gate, GatePin *pin) |
bool | remove_destination (Gate *gate, const std::string &pin_name) |
bool | remove_destination (Gate *gate, const GatePin *pin) |
bool | remove_destination (Endpoint *ep) |
bool | is_a_destination (const Gate *gate) const |
bool | is_a_destination (const Gate *gate, const std::string &pin_name) const |
bool | is_a_destination (const Gate *gate, const GatePin *pin) const |
bool | is_a_destination (const Endpoint *ep) const |
u32 | get_num_of_destinations (const std::function< bool(Endpoint *ep)> &filter=nullptr) const |
std::vector< Endpoint * > | get_destinations (const std::function< bool(Endpoint *ep)> &filter=nullptr) const |
bool | is_unrouted () const |
bool | is_gnd_net () const |
bool | is_vcc_net () const |
bool | mark_global_input_net () |
bool | mark_global_output_net () |
bool | unmark_global_input_net () |
bool | unmark_global_output_net () |
bool | is_global_input_net () const |
bool | is_global_output_net () const |
![]() | |
DataContainer ()=default | |
virtual | ~DataContainer ()=default |
bool | operator== (const DataContainer &other) const |
bool | operator!= (const DataContainer &other) const |
bool | set_data (const std::string &category, const std::string &key, const std::string &data_type, const std::string &value, const bool log_with_info_level=false) |
bool | has_data (const std::string &category, const std::string &key) const |
std::tuple< std::string, std::string > | get_data (const std::string &category, const std::string &key) const |
bool | delete_data (const std::string &category, const std::string &key, const bool log_with_info_level=false) |
const std::map< std::tuple< std::string, std::string >, std::tuple< std::string, std::string > > & | get_data_map () const |
void | set_data_map (const std::map< std::tuple< std::string, std::string >, std::tuple< std::string, std::string >> &map) |
Friends | |
class | NetlistInternalManager |
Additional Inherited Members | |
![]() | |
std::map< std::tuple< std::string, std::string >, std::tuple< std::string, std::string > > | m_data |
Net class containing information about a net including its source and destination.
Add a destination endpoint to the net. The endpoint is specified by a tuple of a gate and the name of an input pin of that gate.
[in] | gate | - The gate. |
[in] | pin_name | - The name of an input pin of the gate. |
nullptr
otherwise. Definition at line 288 of file net.cpp.
References hal::Gate::get_id(), hal::Gate::get_name(), hal::GateType::get_pin_by_name(), hal::Gate::get_type(), and log_warning.
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::net_init(), hal::netlist_utils::remove_buffers(), and hal::netlist_utils::remove_unused_lut_endpoints().
Add a source endpoint to the net. The endpoint is specified by a tuple of a gate and the name of an output pin of that gate.
[in] | gate | - The gate. |
[in] | pin_name | - The name of an output pin of the gate. |
nullptr
otherwise. Definition at line 127 of file net.cpp.
References hal::Gate::get_id(), hal::Gate::get_name(), hal::GateType::get_pin_by_name(), hal::Gate::get_type(), and log_warning.
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::VHDLParser::instantiate(), and hal::net_init().
std::vector< Endpoint * > hal::Net::get_destinations | ( | const std::function< bool(Endpoint *ep)> & | filter = nullptr | ) | const |
Get a vector of destinations of the net. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
[in] | filter | - An optional filter. |
Definition at line 426 of file net.cpp.
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::NetlistTraversalDecorator::get_next_combinational_gates(), hal::NetlistTraversalDecorator::get_next_matching_gates_until_depth(), hal::NetlistTraversalDecorator::get_next_sequential_gates(), hal::net_init(), operator==(), hal::netlist_utils::remove_buffers(), and hal::TEST_F().
Grouping * hal::Net::get_grouping | ( | ) | const |
Get the grouping in which this net is contained.
If no grouping contains this gate, a nullptr is returned.
Definition at line 117 of file net.cpp.
Referenced by hal::net_init().
ssize_t hal::Net::get_hash | ( | ) | const |
Hash function for python binding
Definition at line 83 of file net.cpp.
Referenced by hal::net_init().
u32 hal::Net::get_id | ( | ) | const |
Get the unique id of the net.
Definition at line 88 of file net.cpp.
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::BooleanFunctionNetDecorator::get_boolean_variable_name(), hal::SubgraphNetlistDecorator::get_subgraph_function(), hal::SubgraphNetlistDecorator::get_subgraph_function_inputs(), hal::net_init(), hal::ModulePin::operator==(), operator==(), and hal::netlist_utils::remove_buffers().
const std::string & hal::Net::get_name | ( | ) | const |
Get the name of the net.
Definition at line 98 of file net.cpp.
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::SubgraphNetlistDecorator::get_subgraph_function(), hal::SubgraphNetlistDecorator::get_subgraph_function_inputs(), hal::ModulePinsTreeModel::handleModulePortsChanged(), hal::VerilogParser::instantiate(), hal::VHDLParser::instantiate(), hal::net_init(), operator==(), hal::netlist_utils::remove_buffers(), hal::TEST_F(), and hal::ModuleModel::updateNetName().
Netlist * hal::Net::get_netlist | ( | ) | const |
Get the netlist this net is associated with.
Definition at line 93 of file net.cpp.
Referenced by hal::net_init().
u32 hal::Net::get_num_of_destinations | ( | const std::function< bool(Endpoint *ep)> & | filter = nullptr | ) | const |
Get the number of destinations of the net. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
[in] | filter | - An optional filter. |
Definition at line 408 of file net.cpp.
Referenced by hal::VHDLParser::instantiate(), hal::net_init(), and operator==().
u32 hal::Net::get_num_of_sources | ( | const std::function< bool(Endpoint *ep)> & | filter = nullptr | ) | const |
Get the number of sources of the net. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
[in] | filter | - An optional filter. |
Definition at line 246 of file net.cpp.
Referenced by hal::SubgraphNetlistDecorator::get_subgraph_function(), hal::SubgraphNetlistDecorator::get_subgraph_function_inputs(), hal::net_init(), and operator==().
std::vector< Endpoint * > hal::Net::get_sources | ( | const std::function< bool(Endpoint *ep)> & | filter = nullptr | ) | const |
Get a vector of sources of the net. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
[in] | filter | - An optional filter. |
Definition at line 264 of file net.cpp.
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::NetlistTraversalDecorator::get_next_combinational_gates(), hal::NetlistTraversalDecorator::get_next_matching_gates_until_depth(), hal::NetlistTraversalDecorator::get_next_sequential_gates(), hal::SubgraphNetlistDecorator::get_subgraph_function(), hal::SubgraphNetlistDecorator::get_subgraph_function_inputs(), hal::net_init(), operator==(), and hal::TEST_F().
bool hal::Net::is_a_destination | ( | const Endpoint * | ep | ) | const |
Check whether an endpoint is a destination of the net.
[in] | ep | - The endpoint. |
true
if the endpoint is a destination of the net, false
otherwise. Definition at line 394 of file net.cpp.
References hal::Endpoint::is_destination_pin().
bool hal::Net::is_a_destination | ( | const Gate * | gate | ) | const |
Check whether a gate is a destination of the net independent of the pin.
[in] | gate | - The gate. |
true
if the gate is a destination of the net, false
otherwise. Definition at line 349 of file net.cpp.
References log_warning.
Referenced by is_a_destination(), and hal::net_init().
TODO test Check whether an endpoint is a destination of the net. The endpoint is specified by a tuple of a gate and an input pin of that gate.
[in] | gate | - The gate. |
[in] | pin | - The input pin of the gate. |
true
if the endpoint is a destination of the net, false
otherwise. Definition at line 360 of file net.cpp.
References log_warning.
bool hal::Net::is_a_destination | ( | const Gate * | gate, |
const std::string & | pin_name | ||
) | const |
Check whether an endpoint is a destination of the net. The endpoint is specified by a tuple of a gate and the name of an input pin of that gate.
[in] | gate | - The gate. |
[in] | pin_name | - The name of an input pin of the gate. |
true
if the endpoint is a destination of the net, false
otherwise. Definition at line 377 of file net.cpp.
References hal::Gate::get_id(), hal::Gate::get_name(), hal::GateType::get_pin_by_name(), hal::Gate::get_type(), is_a_destination(), and log_warning.
bool hal::Net::is_a_source | ( | const Endpoint * | ep | ) | const |
Check whether an endpoint is a source of the net.
[in] | ep | - The endpoint. |
true
if the endpoint is a source of the net, false
otherwise. Definition at line 232 of file net.cpp.
References hal::Endpoint::is_source_pin().
bool hal::Net::is_a_source | ( | const Gate * | gate | ) | const |
Check whether a gate is a source of the net independent of the pin.
[in] | gate | - The gate. |
true
if the gate is a source of the net, false
otherwise. Definition at line 187 of file net.cpp.
References log_warning.
Referenced by is_a_source(), and hal::net_init().
TODO test Check whether an endpoint is a source of the net. The endpoint is specified by a tuple of a gate and an output pin of that gate.
[in] | gate | - The gate. |
[in] | pin | - The output pin of the gate. |
true
if the endpoint is a source of the net, false
otherwise. Definition at line 198 of file net.cpp.
References log_warning.
bool hal::Net::is_a_source | ( | const Gate * | gate, |
const std::string & | pin_name | ||
) | const |
Check whether an endpoint is a source of the net. The endpoint is specified by a tuple of a gate and the name of an output pin of that gate.
[in] | gate | - The gate. |
[in] | pin_name | - The name of an output pin of the gate. |
true
if the endpoint is a source of the net, false
otherwise. Definition at line 215 of file net.cpp.
References hal::Gate::get_id(), hal::Gate::get_name(), hal::GateType::get_pin_by_name(), hal::Gate::get_type(), is_a_source(), and log_warning.
bool hal::Net::is_global_input_net | ( | ) | const |
Checks whether this net is a global input net.
true
if the net is a global input net, false
otherwise. Definition at line 480 of file net.cpp.
References hal::Netlist::is_global_input_net().
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::SubgraphNetlistDecorator::get_subgraph_function(), hal::SubgraphNetlistDecorator::get_subgraph_function_inputs(), hal::net_init(), operator==(), and hal::TEST_F().
bool hal::Net::is_global_output_net | ( | ) | const |
Checks whether this net is a global output net.
true
if the net is a global output net, false
otherwise. Definition at line 485 of file net.cpp.
References hal::Netlist::is_global_output_net().
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::net_init(), operator==(), and hal::TEST_F().
bool hal::Net::is_gnd_net | ( | ) | const |
Check whether the net is connected to GND.
true
if the net is connected to GND, false
otherwise. Definition at line 450 of file net.cpp.
Referenced by hal::net_init().
bool hal::Net::is_unrouted | ( | ) | const |
Check whether the net is unrouted, i.e., it has no source or no destination.
true
if the net is unrouted, false
otherwise. Definition at line 445 of file net.cpp.
Referenced by hal::net_init().
bool hal::Net::is_vcc_net | ( | ) | const |
Check whether the net is connected to VCC.
true
if the net is connected to VCC, false
otherwise. Definition at line 455 of file net.cpp.
Referenced by hal::net_init().
bool hal::Net::mark_global_input_net | ( | ) |
Mark this net as a global input net.
true
on success, false
otherwise. Definition at line 460 of file net.cpp.
References hal::Netlist::mark_global_input_net().
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::net_init().
bool hal::Net::mark_global_output_net | ( | ) |
Mark this net as a global output net.
true
on success, false
otherwise. Definition at line 465 of file net.cpp.
References hal::Netlist::mark_global_output_net().
Referenced by hal::net_init().
bool hal::Net::operator!= | ( | const Net & | other | ) | const |
Check whether two nets are unequal.
[in] | other | - The net to compare against. |
Definition at line 78 of file net.cpp.
References operator==().
bool hal::Net::operator== | ( | const Net & | other | ) | const |
Check whether two nets are equal.
[in] | other | - The net to compare against. |
Definition at line 26 of file net.cpp.
References get_destinations(), get_id(), get_name(), get_num_of_destinations(), get_num_of_sources(), get_sources(), is_global_input_net(), is_global_output_net(), and log_debug.
Referenced by operator!=().
bool hal::Net::remove_destination | ( | Endpoint * | ep | ) |
bool hal::Net::remove_destination | ( | Gate * | gate, |
const std::string & | pin_name | ||
) |
TODO test Remove a destination endpoint from the net. The endpoint is specified by a tuple of a gate and the name of an input pin of that gate.
[in] | gate | - The gate. |
[in] | pin_name | - The name of an input pin of the gate. |
true
on success, false
otherwise. Definition at line 319 of file net.cpp.
References hal::Gate::get_id(), hal::Gate::get_name(), hal::GateType::get_pin_by_name(), hal::Gate::get_type(), and log_warning.
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::net_init(), and hal::netlist_utils::remove_buffers().
bool hal::Net::remove_source | ( | Endpoint * | ep | ) |
bool hal::Net::remove_source | ( | Gate * | gate, |
const std::string & | pin_name | ||
) |
TODO test Remove a source endpoint from the net. The endpoint is specified by a tuple of a gate and the name of an output pin of that gate.
[in] | gate | - The gate. |
[in] | pin_name | - The name of an output pin of the gate. |
true
on success, false
otherwise. Definition at line 157 of file net.cpp.
References hal::Gate::get_id(), hal::Gate::get_name(), hal::GateType::get_pin_by_name(), hal::Gate::get_type(), and log_warning.
Referenced by hal::NetlistModificationDecorator::connect_nets(), and hal::net_init().
void hal::Net::set_name | ( | const std::string & | name | ) |
Set the name of the net.
[in] | name | - The new name. |
Definition at line 103 of file net.cpp.
References log_error, name, hal::NetEvent::name_changed, hal::EventHandler::notify(), and hal::utils::trim().
Referenced by hal::net_init().
bool hal::Net::unmark_global_input_net | ( | ) |
Unmark this net as a global input net.
true
on success, false
otherwise. Definition at line 470 of file net.cpp.
References hal::Netlist::unmark_global_input_net().
Referenced by hal::net_init().
bool hal::Net::unmark_global_output_net | ( | ) |
Unmark this net as a global output net.
true
on success, false
otherwise. Definition at line 475 of file net.cpp.
References hal::Netlist::unmark_global_output_net().
Referenced by hal::net_init().
|
friend |