![]() |
HAL
|
#include <netlist.h>
Public Member Functions | |
Netlist (const GateLibrary *gate_library) | |
~Netlist () | |
bool | operator== (const Netlist &other) const |
bool | operator!= (const Netlist &other) const |
u32 | get_id () const |
void | set_id (const u32 id) |
std::filesystem::path | get_input_filename () const |
void | set_input_filename (const std::filesystem::path &path) |
const std::string & | get_design_name () const |
void | set_design_name (const std::string &name) |
const std::string & | get_device_name () const |
void | set_device_name (const std::string &name) |
const GateLibrary * | get_gate_library () const |
Result< std::unique_ptr< Netlist > > | copy () const |
u32 | get_unique_gate_id () |
Gate * | create_gate (const u32 gate_id, GateType *gate_type, const std::string &name="", i32 x=-1, i32 y=-1) |
Gate * | create_gate (GateType *gate_type, const std::string &name="", i32 x=-1, i32 y=-1) |
bool | delete_gate (Gate *gate) |
bool | is_gate_in_netlist (const Gate *gate) const |
Gate * | get_gate_by_id (const u32 gate_id) const |
const std::vector< Gate * > & | get_gates () const |
std::vector< Gate * > | get_gates (const std::function< bool(const Gate *)> &filter) const |
bool | mark_vcc_gate (Gate *gate) |
bool | mark_gnd_gate (Gate *gate) |
bool | unmark_vcc_gate (Gate *gate) |
bool | unmark_gnd_gate (Gate *gate) |
bool | is_vcc_gate (const Gate *gate) const |
bool | is_gnd_gate (const Gate *gate) const |
const std::vector< Gate * > & | get_vcc_gates () const |
const std::vector< Gate * > & | get_gnd_gates () const |
u32 | get_unique_net_id () |
Net * | create_net (const u32 net_id, const std::string &name) |
Net * | create_net (const std::string &name) |
bool | delete_net (Net *net) |
bool | is_net_in_netlist (const Net *net) const |
Net * | get_net_by_id (u32 net_id) const |
const std::vector< Net * > & | get_nets () const |
std::vector< Net * > | get_nets (const std::function< bool(const Net *)> &filter) const |
bool | mark_global_input_net (Net *net) |
bool | mark_global_output_net (Net *net) |
bool | unmark_global_input_net (Net *net) |
bool | unmark_global_output_net (Net *net) |
bool | is_global_input_net (const Net *net) const |
bool | is_global_output_net (const Net *net) const |
const std::vector< Net * > & | get_global_input_nets () const |
const std::vector< Net * > & | get_global_output_nets () const |
std::vector< Net * > | get_gnd_nets () const |
std::vector< Net * > | get_vcc_nets () const |
void | enable_automatic_net_checks (bool enable_checks=true) |
u32 | get_unique_module_id () |
Module * | create_module (const u32 module_id, const std::string &name, Module *parent, const std::vector< Gate * > &gates={}) |
Module * | create_module (const std::string &name, Module *parent, const std::vector< Gate * > &gates={}) |
bool | delete_module (Module *module) |
bool | is_module_in_netlist (const Module *module) const |
Module * | get_module_by_id (u32 module_id) const |
const std::vector< Module * > & | get_modules () const |
std::vector< Module * > | get_modules (const std::function< bool(const Module *)> &filter) const |
Module * | get_top_module () const |
u32 | get_unique_grouping_id () |
Grouping * | create_grouping (const u32 grouping_id, const std::string &name="") |
Grouping * | create_grouping (const std::string &name="") |
bool | delete_grouping (Grouping *grouping) |
bool | is_grouping_in_netlist (const Grouping *grouping) const |
Grouping * | get_grouping_by_id (u32 grouping_id) const |
const std::vector< Grouping * > & | get_groupings () const |
std::vector< Grouping * > | get_groupings (const std::function< bool(const Grouping *)> &filter) const |
u32 | get_next_gate_id () const |
void | set_next_gate_id (const u32 id) |
std::set< u32 > | get_used_gate_ids () const |
void | set_used_gate_ids (const std::set< u32 > ids) |
std::set< u32 > | get_free_gate_ids () const |
void | set_free_gate_ids (const std::set< u32 > ids) |
u32 | get_next_net_id () const |
void | set_next_net_id (const u32 id) |
std::set< u32 > | get_used_net_ids () const |
void | set_used_net_ids (const std::set< u32 > ids) |
std::set< u32 > | get_free_net_ids () const |
void | set_free_net_ids (const std::set< u32 > ids) |
u32 | get_next_module_id () const |
void | set_next_module_id (const u32 id) |
std::set< u32 > | get_used_module_ids () const |
void | set_used_module_ids (const std::set< u32 > ids) |
std::set< u32 > | get_free_module_ids () const |
void | set_free_module_ids (const std::set< u32 > ids) |
u32 | get_next_grouping_id () const |
void | set_next_grouping_id (const u32 id) |
std::set< u32 > | get_used_grouping_ids () const |
void | set_used_grouping_ids (const std::set< u32 > ids) |
std::set< u32 > | get_free_grouping_ids () const |
void | set_free_grouping_ids (const std::set< u32 > ids) |
EventHandler * | get_event_handler () const |
void | clear_caches () |
bool | load_gate_locations_from_data (const std::string &data_category="", const std::pair< std::string, std::string > &data_identifiers=std::pair< std::string, std::string >()) |
Friends | |
class | NetlistInternalManager |
Netlist class containing information about the netlist including its gates, modules, nets, and groupings as well as the underlying gate library.
|
explicit |
Construct a new netlist for the specified gate library.
Warning: Use the netlist_factory to create instances!
[in] | gate_library | - The gate library. |
Definition at line 13 of file netlist.cpp.
References create_module(), and NetlistInternalManager.
hal::Netlist::~Netlist | ( | ) |
Definition at line 26 of file netlist.cpp.
void hal::Netlist::clear_caches | ( | ) |
Clear all internal caches of the netlist.
In a typical application, calling this function is not required.
Definition at line 857 of file netlist.cpp.
Referenced by hal::netlist_init().
Create a deep copy of the netlist.
Definition at line 142 of file netlist.cpp.
References ERR.
Referenced by hal::netlist_utils::copy_netlist(), and hal::netlist_init().
Gate * hal::Netlist::create_gate | ( | const u32 | gate_id, |
GateType * | gate_type, | ||
const std::string & | name = "" , |
||
i32 | x = -1 , |
||
i32 | y = -1 |
||
) |
Create a new gate and add it to the netlist.
[in] | gate_id | - The unique ID of the gate. |
[in] | gate_type | - The gate type. |
[in] | name | - The name of the gate. |
[in] | x | - The x-coordinate of the gate. |
[in] | y | - The y-coordinate of the gate. |
Definition at line 173 of file netlist.cpp.
References name.
Referenced by create_gate(), hal::NetlistModificationDecorator::create_gnd_net(), hal::NetlistModificationDecorator::create_vcc_net(), hal::VHDLParser::instantiate(), hal::netlist_init(), and hal::NetlistModificationDecorator::replace_gate().
Gate * hal::Netlist::create_gate | ( | GateType * | gate_type, |
const std::string & | name = "" , |
||
i32 | x = -1 , |
||
i32 | y = -1 |
||
) |
Create a new gate and add it to the netlist.
The ID of the gate is set automatically.
[in] | gate_type | - The gate type. |
[in] | name | - The name of the gate. |
[in] | x | - The x-coordinate of the gate. |
[in] | y | - The y-coordinate of the gate. |
Definition at line 178 of file netlist.cpp.
References create_gate(), get_unique_gate_id(), and name.
Grouping * hal::Netlist::create_grouping | ( | const std::string & | name = "" | ) |
Create a new grouping and add it to the netlist.
The ID of the grouping is set automatically.
[in] | name | - The name of the grouping. |
Definition at line 676 of file netlist.cpp.
References get_unique_grouping_id(), and name.
Create a new grouping and add it to the netlist.
[in] | grouping_id | - The unique ID of the grouping. |
[in] | name | - The name of the grouping. |
Definition at line 671 of file netlist.cpp.
References name.
Referenced by hal::GroupingTableEntry::GroupingTableEntry(), and hal::netlist_init().
Module * hal::Netlist::create_module | ( | const std::string & | name, |
Module * | parent, | ||
const std::vector< Gate * > & | gates = {} |
||
) |
Create a new module and add it to the netlist.
The ID of the module is set automatically.
[in] | name | - The name of the module. |
[in] | parent | - The parent module. |
[in] | gates | - Gates to assign to the new module. |
Definition at line 598 of file netlist.cpp.
References create_module(), get_unique_module_id(), and name.
Module * hal::Netlist::create_module | ( | const u32 | module_id, |
const std::string & | name, | ||
Module * | parent, | ||
const std::vector< Gate * > & | gates = {} |
||
) |
Create a new module and add it to the netlist.
[in] | module_id | - The unique ID of the module. |
[in] | name | - The name of the module. |
[in] | parent | - The parent module. |
[in] | gates | - Gates to assign to the new module. |
Definition at line 587 of file netlist.cpp.
References hal::Module::assign_gates(), and name.
Referenced by create_module(), hal::ActionCreateObject::exec(), Netlist(), and hal::netlist_init().
Net * hal::Netlist::create_net | ( | const std::string & | name | ) |
Create a new net and add it to the netlist.
The ID of the net is set automatically.
[in] | name | - The name of the net. |
Definition at line 338 of file netlist.cpp.
References get_unique_net_id(), and name.
Create a new net and add it to the netlist.
[in] | net_id | - The unique ID of the net. |
[in] | name | - The name of the net. |
Definition at line 333 of file netlist.cpp.
References name.
Referenced by hal::NetlistModificationDecorator::connect_gates(), hal::NetlistModificationDecorator::create_gnd_net(), hal::NetlistModificationDecorator::create_vcc_net(), hal::ActionCreateObject::exec(), hal::VerilogParser::instantiate(), hal::VHDLParser::instantiate(), and hal::netlist_init().
bool hal::Netlist::delete_gate | ( | Gate * | gate | ) |
Remove a gate from the netlist.
[in] | gate | - The gate. |
Definition at line 183 of file netlist.cpp.
Referenced by hal::ActionDeleteObject::exec(), hal::netlist_init(), and hal::NetlistModificationDecorator::replace_gate().
bool hal::Netlist::delete_grouping | ( | Grouping * | grouping | ) |
Remove a grouping from the netlist.
[in] | grouping | - The grouping. |
Definition at line 681 of file netlist.cpp.
References test_plugin::g.
Referenced by hal::netlist_init(), and hal::GroupingTableModel::removeRows().
bool hal::Netlist::delete_module | ( | Module * | module | ) |
Remove a module from the netlist. Submodules, gates and nets under this module will be moved to the parent of this module.
[in] | module | - The module. |
Definition at line 603 of file netlist.cpp.
References hal::ShortestPath::module().
Referenced by hal::NetlistModificationDecorator::delete_modules(), hal::ActionDeleteObject::exec(), and hal::netlist_init().
bool hal::Netlist::delete_net | ( | Net * | net | ) |
Remove a net from the netlist.
[in] | net | - The net. |
Definition at line 343 of file netlist.cpp.
References test::n.
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::ActionDeleteObject::exec(), hal::VerilogParser::instantiate(), hal::VHDLParser::instantiate(), and hal::netlist_init().
void hal::Netlist::enable_automatic_net_checks | ( | bool | enable_checks = true | ) |
Enables or disables automatic checks on nets that determine whether a net is an input or output of a module.
[in] | enable_checks | - Set true to enable automatic checks, false otherwise. |
Definition at line 563 of file netlist.cpp.
Referenced by hal::netlist_init().
const std::string & hal::Netlist::get_design_name | ( | ) | const |
Get the name of the design.
Definition at line 104 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), hal::netlist_init(), and operator==().
const std::string & hal::Netlist::get_device_name | ( | ) | const |
Get the name of the target device.
Definition at line 118 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), hal::netlist_init(), and operator==().
EventHandler * hal::Netlist::get_event_handler | ( | ) | const |
Get event handler. Should only be used to register callbacks
Definition at line 137 of file netlist.cpp.
Referenced by hal::NetlistRelay::registerNetlistCallbacks(), and hal::NetlistRelay::unregisterNetlistCallbacks().
std::set< u32 > hal::Netlist::get_free_gate_ids | ( | ) | const |
Get a set of all gate IDs that have previously been used but been freed ever since.
Definition at line 751 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().
std::set< u32 > hal::Netlist::get_free_grouping_ids | ( | ) | const |
Get a set of all grouping IDs that have previously been used but been freed ever since.
Definition at line 841 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().
std::set< u32 > hal::Netlist::get_free_module_ids | ( | ) | const |
Get a set of all module IDs that have previously been used but been freed ever since.
Definition at line 811 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().
std::set< u32 > hal::Netlist::get_free_net_ids | ( | ) | const |
Get a set of all net IDs that have previously been used but been freed ever since.
Definition at line 781 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().
Get the gate specified by the given ID.
[in] | gate_id | - The unique ID of the gate. |
Definition at line 193 of file netlist.cpp.
References log_debug.
Referenced by hal::PhysicalGraphLayouter::add(), hal::NodeBoxes::addBox(), hal::ModuleModel::addGate(), hal::ModuleContextMenu::addGateSubmenu(), hal::NetlistRelay::addToModuleDialog(), hal::dataflow::Grouping::are_groups_allowed_to_merge(), hal::Grouping::assign_gate_by_id(), hal::NetlistRelay::changeElementNameDialog(), hal::GroupingTableModel::colorForItem(), hal::CommonSuccessorPredecessor::CommonSuccessorPredecessor(), hal::GuiApi::deselectGate(), hal::ActionAddBooleanFunction::exec(), hal::ActionAddItemsToObject::exec(), hal::ActionDeleteObject::exec(), hal::ActionRenameObject::exec(), hal::ActionSetObjectData::exec(), hal::CoordinateFromData::fromNode(), hal::GateSelectModel::GateSelectModel(), hal::NetlistTraversalDecorator::get_shortest_path(), hal::NetlistTraversalDecorator::get_shortest_path_distance(), hal::GuiApiClasses::View::getGates(), hal::SelectionDetailsIconProvider::getIcon(), hal::GatePinsTreeModel::getNumberOfDisplayedPins(), hal::GuiApi::getSelectedGates(), hal::SelectionDetailsWidget::groupingUnassignActionFactory(), hal::event_log::handle_grouping_event(), hal::event_log::handle_module_event(), hal::NetEndpointTable::handleContextMenuRequested(), hal::PythonGateSelectionReceiver::handleGatesPicked(), hal::GateSelectPicker::handleSelectionChanged(), hal::GraphGraphicsView::handleShortestPath(), hal::ModuleModel::moduleAssignGate(), hal::ModuleModel::moduleAssignNets(), hal::ModuleItem::ModuleItem(), hal::SelectionRelay::navigateDown(), hal::SelectionRelay::navigateUp(), hal::netlist_init(), hal::NodeBox::NodeBox(), hal::GraphContext::nodeForGate(), hal::PyCodeProvider::pyCodeGateAsyncSetResetBehavior(), hal::GraphContext::readFromFile(), hal::Grouping::remove_gate_by_id(), hal::GroupingManagerWidget::removeElementsFromGrouping(), hal::dataflow::Result::Result(), hal::GuiApi::selectGate(), hal::ModuleSelectExclude::selectionToString(), hal::GatePinTree::setGate(), hal::GraphNavigationWidget::setup(), hal::ModuleShader::update(), hal::ModuleModel::updateGateName(), and hal::GraphContext::updateNets().
const GateLibrary * hal::Netlist::get_gate_library | ( | ) | const |
Get the gate library associated with the netlist.
Definition at line 132 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), hal::NetlistModificationDecorator::create_gnd_net(), hal::NetlistModificationDecorator::create_vcc_net(), hal::GateLibraryManager::initialize(), hal::netlist_init(), operator==(), hal::ProjectManager::serialize_project(), and hal::dataflow::Configuration::with_gate_types().
const std::vector< Gate * > & hal::Netlist::get_gates | ( | ) | const |
Get all gates contained within the netlist.
Definition at line 204 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), hal::GateSelectModel::GateSelectModel(), hal::boolean_influence::get_ff_dependency_matrix(), hal::netlist_utils::get_ff_dependency_matrix(), hal::NetlistTraversalDecorator::get_next_sequential_gates_map(), hal::netlist_init(), operator==(), and hal::dataflow::Configuration::with_known_structures().
std::vector< Gate * > hal::Netlist::get_gates | ( | const std::function< bool(const Gate *)> & | filter | ) | const |
Get all gates contained within the netlist.
The filter is evaluated on every gate such that the result only contains gates matching the specified condition.
[in] | filter | - Filter function to be evaluated on each gate. |
Definition at line 209 of file netlist.cpp.
References test_plugin::g.
const std::vector< Net * > & hal::Netlist::get_global_input_nets | ( | ) | const |
Get all global input nets.
Definition at line 519 of file netlist.cpp.
Referenced by hal::netlist_init().
const std::vector< Net * > & hal::Netlist::get_global_output_nets | ( | ) | const |
Get all global output nets.
Definition at line 524 of file netlist.cpp.
Referenced by hal::netlist_init().
const std::vector< Gate * > & hal::Netlist::get_gnd_gates | ( | ) | const |
Get all global GND gates.
Definition at line 309 of file netlist.cpp.
Referenced by hal::VHDLParser::instantiate(), and hal::netlist_init().
std::vector< Net * > hal::Netlist::get_gnd_nets | ( | ) | const |
Get all GND nets in the netlist.
Definition at line 529 of file netlist.cpp.
Referenced by hal::NetlistModificationDecorator::create_gnd_net(), and hal::netlist_init().
Get the grouping specified by the given ID.
[in] | grouping_id | - The unique ID of the grouping. |
Definition at line 691 of file netlist.cpp.
References log_debug.
Referenced by hal::ActionAddItemsToObject::exec(), hal::ActionRemoveItemsFromObject::exec(), hal::GroupingTableEntry::GroupingTableEntry(), hal::netlist_init(), and hal::SelectionTreeView::populate().
const std::vector< Grouping * > & hal::Netlist::get_groupings | ( | ) | const |
Get all groupings contained within the netlist.
Definition at line 702 of file netlist.cpp.
Referenced by hal::GroupingTableModel::GroupingTableModel(), and hal::netlist_init().
std::vector< Grouping * > hal::Netlist::get_groupings | ( | const std::function< bool(const Grouping *)> & | filter | ) | const |
Get all groupings contained within the netlist.
The filter is evaluated on every grouping such that the result only contains groupings matching the specified condition.
[in] | filter | - Filter function to be evaluated on each grouping. |
Definition at line 707 of file netlist.cpp.
u32 hal::Netlist::get_id | ( | ) | const |
Get the ID of the netlist.
If not explicitly set, the ID defaults to 0.
Definition at line 75 of file netlist.cpp.
Referenced by hal::graph_algorithm::NetlistGraph::add_edges(), hal::graph_algorithm::NetlistGraph::delete_edges(), hal::NetlistModificationDecorator::delete_modules(), hal::netlist_utils::get_complex_gate_chain(), hal::netlist_utils::get_gate_chain(), hal::graph_algorithm::NetlistGraph::get_gates_from_vertices(), hal::graph_algorithm::NetlistGraph::get_gates_from_vertices_igraph(), hal::graph_algorithm::NetlistGraph::get_gates_set_from_vertices(), hal::graph_algorithm::NetlistGraph::get_gates_set_from_vertices_igraph(), hal::graph_algorithm::NetlistGraph::get_vertices_from_gates(), hal::graph_algorithm::NetlistGraph::get_vertices_from_gates_igraph(), hal::netlist_init(), operator==(), and hal::Module::set_parent_module().
std::filesystem::path hal::Netlist::get_input_filename | ( | ) | const |
Get the path to the input file.
Definition at line 90 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), hal::netlist_init(), and operator==().
Get the module specified by the given ID.
[in] | module_id | - The unique ID of the module. |
Definition at line 613 of file netlist.cpp.
References log_debug.
Referenced by hal::WaitToBeSeatedList::add(), hal::NodeBoxes::addBox(), hal::NetlistRelay::addChildModuleDialog(), hal::ModuleModel::addGate(), hal::ModuleModel::addModule(), hal::ModuleContextMenu::addModuleSubmenu(), hal::ModuleModel::addNet(), hal::NetlistRelay::addToModuleDialog(), hal::ModuleSelectModel::appendEntries(), hal::ModuleItem::appendExistingChildIfAny(), hal::Grouping::assign_module_by_id(), hal::NetlistRelay::changeElementNameDialog(), hal::NetlistRelay::changeModuleColorDialog(), hal::NetlistRelay::changeModuleTypeDialog(), hal::GroupingTableModel::colorForItem(), hal::GuiApi::deselectModule(), hal::ActionAddItemsToObject::exec(), hal::ActionCreateObject::exec(), hal::ActionDeleteObject::exec(), hal::ActionFoldModule::exec(), hal::ActionPingroup::exec(), hal::ActionRenameObject::exec(), hal::ActionSetObjectColor::exec(), hal::ActionSetObjectData::exec(), hal::ActionSetObjectType::exec(), hal::ActionUnfoldModule::exec(), hal::CoordinateFromData::fromNode(), hal::GraphContext::getModuleChildrenRecursively(), hal::GuiApiClasses::View::getModules(), hal::ModulePinsTreeModel::getNetFromItem(), hal::GuiApi::getSelectedModules(), hal::SelectionDetailsWidget::groupingUnassignActionFactory(), hal::event_log::handle_grouping_event(), hal::event_log::handle_module_event(), hal::ModulePinsTree::handleContextMenuRequested(), hal::PythonModuleSelectionReceiver::handleModulesPicked(), hal::AddToModuleReceiver::handleModulesPicked(), hal::ModuleSelectPicker::handleSelectionChanged(), hal::GraphContext::isModuleUnfolded(), hal::ModuleItem::ModuleItem(), hal::ModulePinsTreeModel::ModulePinsTreeModel(), hal::SelectionRelay::navigateDown(), hal::SelectionRelay::navigateUp(), hal::netlist_init(), hal::NodeBox::NodeBox(), hal::GraphContextManager::openModuleInView(), hal::ModuleModel::populateTree(), hal::GraphContext::readFromFile(), hal::Grouping::remove_module_by_id(), hal::GroupingManagerWidget::removeElementsFromGrouping(), hal::ModuleSelectExclude::selectionToString(), hal::GuiApi::selectModule(), hal::ModuleElementsTree::setModule(), hal::ModulePinsTree::setModule(), hal::ModuleItem::setModuleType(), hal::GraphNavigationWidget::setup(), hal::GraphContext::unfoldModule(), hal::ModuleModel::updateModuleName(), and hal::GraphContext::updateNets().
const std::vector< Module * > & hal::Netlist::get_modules | ( | ) | const |
Get all modules contained within the netlist, including the top module.
Definition at line 624 of file netlist.cpp.
Referenced by hal::ModuleSelectModel::appendEntries(), hal::NetlistModificationDecorator::connect_nets(), hal::NetlistRelay::debugHandleFileOpened(), hal::NetlistModificationDecorator::delete_modules(), hal::netlist_init(), operator==(), and hal::ModuleTableModel::setNet().
std::vector< Module * > hal::Netlist::get_modules | ( | const std::function< bool(const Module *)> & | filter | ) | const |
Get all modules contained within the netlist, including the top module.
The filter is evaluated on every module such that the result only contains modules matching the specified condition.
[in] | filter | - Filter function to be evaluated on each module. |
Definition at line 629 of file netlist.cpp.
References hal::ShortestPath::module().
Get the net specified by the given ID.
[in] | net_id | - The unique ID of the net. |
Definition at line 353 of file netlist.cpp.
References log_debug.
Referenced by hal::ModuleModel::addNet(), hal::ModuleContextMenu::addNetSubmenu(), hal::Grouping::assign_net_by_id(), hal::NetlistRelay::changeElementNameDialog(), hal::GroupingTableModel::colorForItem(), hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), hal::GuiApi::deselectNet(), hal::ActionDeleteObject::exec(), hal::ActionRenameObject::exec(), hal::ActionSetObjectData::exec(), hal::GuiApi::getSelectedNets(), hal::SelectionDetailsWidget::groupingUnassignActionFactory(), hal::event_log::handle_grouping_event(), hal::GatePinTree::handleContextMenuRequested(), hal::ModuleTableModel::handleModulePortsChanged(), hal::ModuleTableModel::handleModuleRemoved(), hal::GraphContext::isShowingNetDestination(), hal::GraphContext::isShowingNetSource(), hal::ModuleItem::ModuleItem(), hal::GatePinTree::mouseDoubleClickEvent(), hal::SelectionRelay::navigateDown(), hal::SelectionRelay::navigateUp(), hal::netlist_init(), hal::GraphContextManager::openNetEndpointsInView(), hal::GraphContext::readFromFile(), hal::Grouping::remove_net_by_id(), hal::dataflow::Result::Result(), hal::DrawNetThread::run(), hal::GuiApi::selectNet(), hal::NetEndpointTable::setNet(), hal::NetModuleTable::setNet(), hal::GraphNavigationWidget::setup(), and hal::ModuleModel::updateNetName().
const std::vector< Net * > & hal::Netlist::get_nets | ( | ) | const |
Get all nets contained within the netlist.
Definition at line 364 of file netlist.cpp.
Referenced by hal::VerilogParser::instantiate(), hal::VHDLParser::instantiate(), hal::netlist_init(), and operator==().
std::vector< Net * > hal::Netlist::get_nets | ( | const std::function< bool(const Net *)> & | filter | ) | const |
Get all nets contained within the netlist.
The filter is evaluated on every net such that the result only contains nets matching the specified condition.
[in] | filter | - Filter function to be evaluated on each net. |
Definition at line 369 of file netlist.cpp.
References net.
u32 hal::Netlist::get_next_gate_id | ( | ) | const |
Get the gate ID following the highest currently used ID.
Definition at line 731 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().
u32 hal::Netlist::get_next_grouping_id | ( | ) | const |
Get the grouping ID following the highest currently used ID.
Definition at line 821 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().
u32 hal::Netlist::get_next_module_id | ( | ) | const |
Get the module ID following the highest currently used ID.
Definition at line 791 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().
u32 hal::Netlist::get_next_net_id | ( | ) | const |
Get the net ID following the highest currently used ID.
Definition at line 761 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().
Module * hal::Netlist::get_top_module | ( | ) | const |
Get the top module of the netlist.
Definition at line 608 of file netlist.cpp.
Referenced by hal::ModuleContextMenu::addModuleSubmenu(), hal::GuiApiClasses::View::addTo(), hal::dumpPingroups(), hal::ActionDeleteObject::exec(), hal::GuiApiClasses::View::getValidObjects(), hal::ModuleWidget::ModuleWidget(), hal::netlist_init(), operator==(), and hal::Module::remove_gates().
u32 hal::Netlist::get_unique_gate_id | ( | ) |
Get a spare gate ID.
The value of 0 is reserved and represents an invalid ID.
Definition at line 160 of file netlist.cpp.
Referenced by create_gate(), hal::VHDLParser::instantiate(), and hal::netlist_init().
u32 hal::Netlist::get_unique_grouping_id | ( | ) |
Gets a spare grouping ID.
The value of 0 is reserved and represents an invalid ID.
Definition at line 658 of file netlist.cpp.
Referenced by create_grouping(), and hal::netlist_init().
u32 hal::Netlist::get_unique_module_id | ( | ) |
Get a spare module ID.
The value of 0 is reserved and represents an invalid ID.
Definition at line 574 of file netlist.cpp.
Referenced by create_module(), hal::ActionCreateObject::exec(), and hal::netlist_init().
u32 hal::Netlist::get_unique_net_id | ( | ) |
Get a spare net ID.
The value of 0 is reserved and represents an invalid ID.
Definition at line 320 of file netlist.cpp.
Referenced by create_net(), and hal::netlist_init().
std::set< u32 > hal::Netlist::get_used_gate_ids | ( | ) | const |
Get a set of all currently used gate IDs.
Definition at line 741 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), hal::netlist_init(), and hal::PluginParameterNodeDialog::PluginParameterNodeDialog().
std::set< u32 > hal::Netlist::get_used_grouping_ids | ( | ) | const |
Get a set of all currently used grouping IDs.
Definition at line 831 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().
std::set< u32 > hal::Netlist::get_used_module_ids | ( | ) | const |
Get a set of all currently used module IDs.
Definition at line 801 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), hal::netlist_init(), and hal::PluginParameterNodeDialog::PluginParameterNodeDialog().
std::set< u32 > hal::Netlist::get_used_net_ids | ( | ) | const |
Get a set of all currently used net IDs.
Definition at line 771 of file netlist.cpp.
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().
const std::vector< Gate * > & hal::Netlist::get_vcc_gates | ( | ) | const |
Get all global VCC gates.
Definition at line 304 of file netlist.cpp.
Referenced by hal::VHDLParser::instantiate(), and hal::netlist_init().
std::vector< Net * > hal::Netlist::get_vcc_nets | ( | ) | const |
Get all VCC nets in the netlist.
Definition at line 546 of file netlist.cpp.
Referenced by hal::NetlistModificationDecorator::create_vcc_net(), and hal::netlist_init().
bool hal::Netlist::is_gate_in_netlist | ( | const Gate * | gate | ) | const |
Check whether the gate is registered in the netlist.
[in] | gate | - The gate to check. |
Definition at line 188 of file netlist.cpp.
Referenced by hal::GuiApi::deselectGate(), hal::NetlistTraversalDecorator::get_next_combinational_gates(), hal::NetlistTraversalDecorator::get_next_matching_gates_until_depth(), hal::NetlistTraversalDecorator::get_next_sequential_gates(), mark_gnd_gate(), mark_vcc_gate(), hal::netlist_init(), hal::GuiApi::selectGate(), hal::GateInfoTable::setGate(), unmark_gnd_gate(), and unmark_vcc_gate().
bool hal::Netlist::is_global_input_net | ( | const Net * | net | ) | const |
Checks whether a net is a global input net.
[in] | net | - The net to check. |
Definition at line 509 of file netlist.cpp.
References test::n.
Referenced by hal::Net::is_global_input_net(), mark_global_input_net(), and hal::netlist_init().
bool hal::Netlist::is_global_output_net | ( | const Net * | net | ) | const |
Checks whether a net is a global output net.
[in] | net | - The net to check. |
Definition at line 514 of file netlist.cpp.
References test::n.
Referenced by hal::Net::is_global_output_net(), mark_global_output_net(), and hal::netlist_init().
bool hal::Netlist::is_gnd_gate | ( | const Gate * | gate | ) | const |
Check whether a gate is a global GND gate.
[in] | gate | - The gate to check. |
Definition at line 299 of file netlist.cpp.
Referenced by mark_gnd_gate(), and hal::netlist_init().
bool hal::Netlist::is_grouping_in_netlist | ( | const Grouping * | grouping | ) | const |
Check whether the grouping is registered in the netlist.
[in] | grouping | - The grouping to check. |
Definition at line 686 of file netlist.cpp.
References test::n.
Referenced by hal::netlist_init().
bool hal::Netlist::is_module_in_netlist | ( | const Module * | module | ) | const |
Check whether the module is registered in the netlist.
[in] | module | - The module to check. |
Definition at line 647 of file netlist.cpp.
References hal::ShortestPath::module().
Referenced by hal::GuiApi::deselectModule(), hal::netlist_init(), hal::GuiApi::selectModule(), and hal::ModuleInfoTable::setModule().
bool hal::Netlist::is_net_in_netlist | ( | const Net * | net | ) | const |
Check whether the net is registered in the netlist.
[in] | net | - The net to check. |
Definition at line 348 of file netlist.cpp.
References test::n.
Referenced by hal::GuiApi::deselectNet(), hal::NetlistTraversalDecorator::get_next_combinational_gates(), hal::NetlistTraversalDecorator::get_next_matching_gates_until_depth(), hal::NetlistTraversalDecorator::get_next_sequential_gates(), mark_global_input_net(), mark_global_output_net(), hal::netlist_init(), hal::GuiApi::selectNet(), hal::NetInfoTable::setNet(), unmark_global_input_net(), and unmark_global_output_net().
bool hal::Netlist::is_vcc_gate | ( | const Gate * | gate | ) | const |
Check whether a gate is a global VCC gate.
[in] | gate | - The gate to check. |
Definition at line 294 of file netlist.cpp.
Referenced by mark_vcc_gate(), and hal::netlist_init().
bool hal::Netlist::load_gate_locations_from_data | ( | const std::string & | data_category = "" , |
const std::pair< std::string, std::string > & | data_identifiers = std::pair<std::string, std::string>() |
||
) |
Load the locations of the gates in the netlist from their associated data using the specified category and identifier. If no parameter is given, the data is querried using the default category and identifier stored with the gate library.
[in] | data_category | - The data category. |
[in] | data_identifiers | - The data identifiers for the x- and y-coordinates. |
Definition at line 862 of file netlist.cpp.
References hal::GateLibrary::get_gate_location_data_category(), hal::GateLibrary::get_gate_location_data_identifiers(), log_error, and log_warning.
Referenced by hal::VerilogParser::instantiate(), hal::VHDLParser::instantiate(), and hal::netlist_init().
bool hal::Netlist::mark_global_input_net | ( | Net * | net | ) |
Mark a net as a global input net.
[in] | net | - The net. |
Definition at line 387 of file netlist.cpp.
References is_global_input_net(), is_net_in_netlist(), log_debug, hal::NetlistEvent::marked_global_input, and test::n.
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::Net::mark_global_input_net(), and hal::netlist_init().
bool hal::Netlist::mark_global_output_net | ( | Net * | net | ) |
Mark a net as a global output net.
[in] | net | - The net. |
Definition at line 417 of file netlist.cpp.
References is_global_output_net(), is_net_in_netlist(), log_debug, hal::NetlistEvent::marked_global_output, and test::n.
Referenced by hal::NetlistModificationDecorator::connect_nets(), hal::Net::mark_global_output_net(), and hal::netlist_init().
bool hal::Netlist::mark_gnd_gate | ( | Gate * | gate | ) |
Mark a gate as a global GND gate.
[in] | gate | - The gate. |
Definition at line 244 of file netlist.cpp.
References hal::Gate::get_id(), hal::Gate::get_name(), is_gate_in_netlist(), is_gnd_gate(), log_debug, and hal::NetlistEvent::marked_global_gnd.
Referenced by hal::VHDLParser::instantiate(), and hal::netlist_init().
bool hal::Netlist::mark_vcc_gate | ( | Gate * | gate | ) |
Mark a gate as a global VCC gate.
[in] | gate | - The gate. |
Definition at line 228 of file netlist.cpp.
References hal::Gate::get_id(), hal::Gate::get_name(), is_gate_in_netlist(), is_vcc_gate(), log_debug, and hal::NetlistEvent::marked_global_vcc.
Referenced by hal::VHDLParser::instantiate(), and hal::netlist_init().
bool hal::Netlist::operator!= | ( | const Netlist & | other | ) | const |
Check whether two netlists are unequal. Does not check netlist IDs.
[in] | other | - The netlist to compare against. |
Definition at line 70 of file netlist.cpp.
References operator==().
bool hal::Netlist::operator== | ( | const Netlist & | other | ) | const |
Check whether two netlists are equal. Does not check netlist IDs.
[in] | other | - The netlist to compare against. |
Definition at line 31 of file netlist.cpp.
References get_design_name(), get_device_name(), get_gate_library(), get_gates(), get_id(), get_input_filename(), get_modules(), get_nets(), get_top_module(), log_info, and net.
Referenced by operator!=().
void hal::Netlist::set_design_name | ( | const std::string & | name | ) |
Set the name of the design.
[in] | name | - The new name of the design. |
Definition at line 109 of file netlist.cpp.
References hal::NetlistEvent::design_name_changed.
Referenced by hal::netlist_init().
void hal::Netlist::set_device_name | ( | const std::string & | name | ) |
Set the name of the target device.
[in] | name | - The name of the target device. |
Definition at line 123 of file netlist.cpp.
References hal::NetlistEvent::device_name_changed.
Referenced by hal::netlist_init().
void hal::Netlist::set_free_gate_ids | ( | const std::set< u32 > | ids | ) |
Set a set of all gate IDs that have previously been used but been freed ever since.
[in] | ids | - All freed gate IDs. |
Definition at line 756 of file netlist.cpp.
Referenced by hal::netlist_init().
void hal::Netlist::set_free_grouping_ids | ( | const std::set< u32 > | ids | ) |
Get a set of all grouping IDs that have previously been used but been freed ever since.
[in] | ids | - All freed grouping ids. |
Definition at line 846 of file netlist.cpp.
Referenced by hal::netlist_init().
void hal::Netlist::set_free_module_ids | ( | const std::set< u32 > | ids | ) |
Set a set of all module IDs that have previously been used but been freed ever since.
[in] | ids | - All freed module IDs. |
Definition at line 816 of file netlist.cpp.
Referenced by hal::netlist_init().
void hal::Netlist::set_free_net_ids | ( | const std::set< u32 > | ids | ) |
Set a set of all net IDs that have previously been used but been freed ever since.
[in] | ids | - All freed net IDs. |
Definition at line 786 of file netlist.cpp.
Referenced by hal::netlist_init().
void hal::Netlist::set_id | ( | const u32 | id | ) |
Set the ID of the netlist to the specified value.
[in] | id | - The new ID of the netlist. |
Definition at line 80 of file netlist.cpp.
References id, and hal::NetlistEvent::id_changed.
Referenced by hal::netlist_init().
void hal::Netlist::set_input_filename | ( | const std::filesystem::path & | path | ) |
Set the path to the input file.
[in] | path | - The path to the input file. |
Definition at line 95 of file netlist.cpp.
References hal::NetlistEvent::input_filename_changed.
Referenced by hal::netlist_init().
void hal::Netlist::set_next_gate_id | ( | const u32 | id | ) |
Set the gate ID following the highest currently used ID.
[in] | id | - The next gate ID. |
Definition at line 736 of file netlist.cpp.
References id.
Referenced by hal::netlist_init().
void hal::Netlist::set_next_grouping_id | ( | const u32 | id | ) |
Set the grouping ID following the highest currently used ID.
[in] | id | - The next grouping ID. |
Definition at line 826 of file netlist.cpp.
References id.
Referenced by hal::netlist_init().
void hal::Netlist::set_next_module_id | ( | const u32 | id | ) |
Set the module ID following the highest currently used ID.
[in] | id | - The next module id. |
Definition at line 796 of file netlist.cpp.
References id.
Referenced by hal::netlist_init().
void hal::Netlist::set_next_net_id | ( | const u32 | id | ) |
Set the net ID following the highest currently used ID.
[in] | id | - The next net ID. |
Definition at line 766 of file netlist.cpp.
References id.
Referenced by hal::netlist_init().
void hal::Netlist::set_used_gate_ids | ( | const std::set< u32 > | ids | ) |
Set a set of all currently used gate IDs.
[in] | ids | - All used gate IDs. |
Definition at line 746 of file netlist.cpp.
Referenced by hal::netlist_init().
void hal::Netlist::set_used_grouping_ids | ( | const std::set< u32 > | ids | ) |
Set a set of all currently used grouping IDs.
[in] | ids | - All used grouping IDs. |
Definition at line 836 of file netlist.cpp.
Referenced by hal::netlist_init().
void hal::Netlist::set_used_module_ids | ( | const std::set< u32 > | ids | ) |
Set a set of all currently used module IDs.
[in] | ids | - All used module IDs. |
Definition at line 806 of file netlist.cpp.
Referenced by hal::netlist_init().
void hal::Netlist::set_used_net_ids | ( | const std::set< u32 > | ids | ) |
Set a set of all currently used net IDs.
[in] | ids | - All used net IDs. |
Definition at line 776 of file netlist.cpp.
Referenced by hal::netlist_init().
bool hal::Netlist::unmark_global_input_net | ( | Net * | net | ) |
Unmark a global input net.
[in] | net | - The net. |
Definition at line 447 of file netlist.cpp.
References is_net_in_netlist(), log_debug, test::n, and hal::NetlistEvent::unmarked_global_input.
Referenced by hal::netlist_init(), and hal::Net::unmark_global_input_net().
bool hal::Netlist::unmark_global_output_net | ( | Net * | net | ) |
Unmark a global output net.
[in] | net | - The net. |
Definition at line 478 of file netlist.cpp.
References is_net_in_netlist(), log_debug, test::n, and hal::NetlistEvent::unmarked_global_output.
Referenced by hal::netlist_init(), and hal::Net::unmark_global_output_net().
bool hal::Netlist::unmark_gnd_gate | ( | Gate * | gate | ) |
Unmark a global GND gate.
[in] | gate | - The gate. |
Definition at line 277 of file netlist.cpp.
References hal::Gate::get_id(), hal::Gate::get_name(), is_gate_in_netlist(), log_debug, and hal::NetlistEvent::unmarked_global_gnd.
Referenced by hal::netlist_init().
bool hal::Netlist::unmark_vcc_gate | ( | Gate * | gate | ) |
Unmark a global VCC gate.
[in] | gate | - The gate. |
Definition at line 260 of file netlist.cpp.
References hal::Gate::get_id(), hal::Gate::get_name(), is_gate_in_netlist(), log_debug, and hal::NetlistEvent::unmarked_global_vcc.
Referenced by hal::netlist_init().
|
friend |