HAL
hal::Netlist Class Reference

#include <netlist.h>

Collaboration diagram for hal::Netlist:
Collaboration graph

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 GateLibraryget_gate_library () const
 
Result< std::unique_ptr< Netlist > > copy () const
 
u32 get_unique_gate_id ()
 
Gatecreate_gate (const u32 gate_id, GateType *gate_type, const std::string &name="", i32 x=-1, i32 y=-1)
 
Gatecreate_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
 
Gateget_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 ()
 
Netcreate_net (const u32 net_id, const std::string &name)
 
Netcreate_net (const std::string &name)
 
bool delete_net (Net *net)
 
bool is_net_in_netlist (const Net *net) const
 
Netget_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 ()
 
Modulecreate_module (const u32 module_id, const std::string &name, Module *parent, const std::vector< Gate * > &gates={})
 
Modulecreate_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
 
Moduleget_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
 
Moduleget_top_module () const
 
u32 get_unique_grouping_id ()
 
Groupingcreate_grouping (const u32 grouping_id, const std::string &name="")
 
Groupingcreate_grouping (const std::string &name="")
 
bool delete_grouping (Grouping *grouping)
 
bool is_grouping_in_netlist (const Grouping *grouping) const
 
Groupingget_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< u32get_used_gate_ids () const
 
void set_used_gate_ids (const std::set< u32 > ids)
 
std::set< u32get_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< u32get_used_net_ids () const
 
void set_used_net_ids (const std::set< u32 > ids)
 
std::set< u32get_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< u32get_used_module_ids () const
 
void set_used_module_ids (const std::set< u32 > ids)
 
std::set< u32get_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< u32get_used_grouping_ids () const
 
void set_used_grouping_ids (const std::set< u32 > ids)
 
std::set< u32get_free_grouping_ids () const
 
void set_free_grouping_ids (const std::set< u32 > ids)
 
EventHandlerget_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
 

Detailed Description

Netlist class containing information about the netlist including its gates, modules, nets, and groupings as well as the underlying gate library.

Definition at line 55 of file netlist.h.

Constructor & Destructor Documentation

◆ Netlist()

hal::Netlist::Netlist ( const GateLibrary gate_library)
explicit

Construct a new netlist for the specified gate library.
Warning: Use the netlist_factory to create instances!

Parameters
[in]gate_library- The gate library.

Definition at line 13 of file netlist.cpp.

References create_module(), and NetlistInternalManager.

◆ ~Netlist()

hal::Netlist::~Netlist ( )

Definition at line 26 of file netlist.cpp.

Member Function Documentation

◆ clear_caches()

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().

◆ copy()

Result< std::unique_ptr< Netlist > > hal::Netlist::copy ( ) const

Create a deep copy of the netlist.

Returns
The copy of the netlist on success, an error otherwise.

Definition at line 142 of file netlist.cpp.

References ERR.

Referenced by hal::netlist_utils::copy_netlist(), and hal::netlist_init().

◆ create_gate() [1/2]

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.

Parameters
[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.
Returns
The new gate on success, nullptr otherwise.

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().

◆ create_gate() [2/2]

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.

Parameters
[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.
Returns
The new gate on success, nullptr otherwise.

Definition at line 178 of file netlist.cpp.

References create_gate(), get_unique_gate_id(), and name.

◆ create_grouping() [1/2]

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.

Parameters
[in]name- The name of the grouping.
Returns
The new grouping on success, nullptr otherwise.

Definition at line 676 of file netlist.cpp.

References get_unique_grouping_id(), and name.

◆ create_grouping() [2/2]

Grouping * hal::Netlist::create_grouping ( const u32  grouping_id,
const std::string &  name = "" 
)

Create a new grouping and add it to the netlist.

Parameters
[in]grouping_id- The unique ID of the grouping.
[in]name- The name of the grouping.
Returns
The new grouping on success, nullptr otherwise.

Definition at line 671 of file netlist.cpp.

References name.

Referenced by hal::GroupingTableEntry::GroupingTableEntry(), and hal::netlist_init().

◆ create_module() [1/2]

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.

Parameters
[in]name- The name of the module.
[in]parent- The parent module.
[in]gates- Gates to assign to the new module.
Returns
The new module on success, nullptr otherwise.

Definition at line 598 of file netlist.cpp.

References create_module(), get_unique_module_id(), and name.

◆ create_module() [2/2]

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.

Parameters
[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.
Returns
The new module on success, nullptr otherwise.

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().

◆ create_net() [1/2]

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.

Parameters
[in]name- The name of the net.
Returns
The new net on success, nullptr otherwise.

Definition at line 338 of file netlist.cpp.

References get_unique_net_id(), and name.

◆ create_net() [2/2]

Net * hal::Netlist::create_net ( const u32  net_id,
const std::string &  name 
)

Create a new net and add it to the netlist.

Parameters
[in]net_id- The unique ID of the net.
[in]name- The name of the net.
Returns
The new net on success, nullptr otherwise.

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().

◆ delete_gate()

bool hal::Netlist::delete_gate ( Gate gate)

Remove a gate from the netlist.

Parameters
[in]gate- The gate.
Returns
True on success, false otherwise.

Definition at line 183 of file netlist.cpp.

Referenced by hal::ActionDeleteObject::exec(), hal::netlist_init(), and hal::NetlistModificationDecorator::replace_gate().

◆ delete_grouping()

bool hal::Netlist::delete_grouping ( Grouping grouping)

Remove a grouping from the netlist.

Parameters
[in]grouping- The grouping.
Returns
True on success, false otherwise.

Definition at line 681 of file netlist.cpp.

References test_plugin::g.

Referenced by hal::netlist_init(), and hal::GroupingTableModel::removeRows().

◆ delete_module()

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.

Parameters
[in]module- The module.
Returns
True on success, false otherwise.

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().

◆ delete_net()

bool hal::Netlist::delete_net ( Net net)

Remove a net from the netlist.

Parameters
[in]net- The net.
Returns
True on success, false otherwise.

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().

◆ enable_automatic_net_checks()

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.

Warning
{WARNING: if disabled, the user is responsible to assign correct input and output nets and create respective module pins. Wrong usage may result in unknown behavior or crashes.}
Parameters
[in]enable_checks- Set true to enable automatic checks, false otherwise.

Definition at line 563 of file netlist.cpp.

Referenced by hal::netlist_init().

◆ get_design_name()

const std::string & hal::Netlist::get_design_name ( ) const

Get the name of the design.

Returns
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==().

◆ get_device_name()

const std::string & hal::Netlist::get_device_name ( ) const

Get the name of the target device.

Returns
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==().

◆ get_event_handler()

EventHandler * hal::Netlist::get_event_handler ( ) const

Get event handler. Should only be used to register callbacks

Returns
Pointer to netlist event handler

Definition at line 137 of file netlist.cpp.

Referenced by hal::NetlistRelay::registerNetlistCallbacks(), and hal::NetlistRelay::unregisterNetlistCallbacks().

◆ get_free_gate_ids()

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.

Returns
All freed gate IDs.

Definition at line 751 of file netlist.cpp.

Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().

◆ get_free_grouping_ids()

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.

Returns
All freed grouping ids.

Definition at line 841 of file netlist.cpp.

Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().

◆ get_free_module_ids()

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.

Returns
All freed module IDs.

Definition at line 811 of file netlist.cpp.

Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().

◆ get_free_net_ids()

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.

Returns
All freed net IDs.

Definition at line 781 of file netlist.cpp.

Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().

◆ get_gate_by_id()

Gate * hal::Netlist::get_gate_by_id ( const u32  gate_id) const

Get the gate specified by the given ID.

Parameters
[in]gate_id- The unique ID of the gate.
Returns
The gate on success, nullptr otherwise.

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().

◆ get_gate_library()

◆ get_gates() [1/2]

◆ get_gates() [2/2]

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.

Parameters
[in]filter- Filter function to be evaluated on each gate.
Returns
A vector of gates.

Definition at line 209 of file netlist.cpp.

References test_plugin::g.

◆ get_global_input_nets()

const std::vector< Net * > & hal::Netlist::get_global_input_nets ( ) const

Get all global input nets.

Returns
A vector of nets.

Definition at line 519 of file netlist.cpp.

Referenced by hal::netlist_init().

◆ get_global_output_nets()

const std::vector< Net * > & hal::Netlist::get_global_output_nets ( ) const

Get all global output nets.

Returns
A vector of nets.

Definition at line 524 of file netlist.cpp.

Referenced by hal::netlist_init().

◆ get_gnd_gates()

const std::vector< Gate * > & hal::Netlist::get_gnd_gates ( ) const

Get all global GND gates.

Returns
A vector of gates.

Definition at line 309 of file netlist.cpp.

Referenced by hal::VHDLParser::instantiate(), and hal::netlist_init().

◆ get_gnd_nets()

std::vector< Net * > hal::Netlist::get_gnd_nets ( ) const

Get all GND nets in the netlist.

Returns
A vector nets.

Definition at line 529 of file netlist.cpp.

Referenced by hal::NetlistModificationDecorator::create_gnd_net(), and hal::netlist_init().

◆ get_grouping_by_id()

Grouping * hal::Netlist::get_grouping_by_id ( u32  grouping_id) const

Get the grouping specified by the given ID.

Parameters
[in]grouping_id- The unique ID of the grouping.
Returns
The grouping on success, nullptr otherwise.

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().

◆ get_groupings() [1/2]

const std::vector< Grouping * > & hal::Netlist::get_groupings ( ) const

Get all groupings contained within the netlist.

Returns
A vector of groupings.

Definition at line 702 of file netlist.cpp.

Referenced by hal::GroupingTableModel::GroupingTableModel(), and hal::netlist_init().

◆ get_groupings() [2/2]

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.

Parameters
[in]filter- Filter function to be evaluated on each grouping.
Returns
A vector of groupings.

Definition at line 707 of file netlist.cpp.

◆ get_id()

◆ get_input_filename()

std::filesystem::path hal::Netlist::get_input_filename ( ) const

Get the path to the input file.

Returns
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_module_by_id()

Module * hal::Netlist::get_module_by_id ( u32  module_id) const

Get the module specified by the given ID.

Parameters
[in]module_id- The unique ID of the module.
Returns
The module on success, nullptr otherwise.

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().

◆ get_modules() [1/2]

const std::vector< Module * > & hal::Netlist::get_modules ( ) const

◆ get_modules() [2/2]

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.

Parameters
[in]filter- Filter function to be evaluated on each module.
Returns
A vector of modules.

Definition at line 629 of file netlist.cpp.

References hal::ShortestPath::module().

◆ get_net_by_id()

Net * hal::Netlist::get_net_by_id ( u32  net_id) const

◆ get_nets() [1/2]

const std::vector< Net * > & hal::Netlist::get_nets ( ) const

Get all nets contained within the netlist.

Returns
A vector of nets.

Definition at line 364 of file netlist.cpp.

Referenced by hal::VerilogParser::instantiate(), hal::VHDLParser::instantiate(), hal::netlist_init(), and operator==().

◆ get_nets() [2/2]

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.

Parameters
[in]filter- Filter function to be evaluated on each net.
Returns
A vector of nets.

Definition at line 369 of file netlist.cpp.

References net.

◆ get_next_gate_id()

u32 hal::Netlist::get_next_gate_id ( ) const

Get the gate ID following the highest currently used ID.

Returns
The next gate ID.

Definition at line 731 of file netlist.cpp.

Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().

◆ get_next_grouping_id()

u32 hal::Netlist::get_next_grouping_id ( ) const

Get the grouping ID following the highest currently used ID.

Returns
The next grouping ID.

Definition at line 821 of file netlist.cpp.

Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().

◆ get_next_module_id()

u32 hal::Netlist::get_next_module_id ( ) const

Get the module ID following the highest currently used ID.

Returns
The next module ID.

Definition at line 791 of file netlist.cpp.

Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().

◆ get_next_net_id()

u32 hal::Netlist::get_next_net_id ( ) const

Get the net ID following the highest currently used ID.

Returns
The next net ID.

Definition at line 761 of file netlist.cpp.

Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().

◆ get_top_module()

◆ get_unique_gate_id()

u32 hal::Netlist::get_unique_gate_id ( )

Get a spare gate ID.
The value of 0 is reserved and represents an invalid ID.

Returns
The gate ID.

Definition at line 160 of file netlist.cpp.

Referenced by create_gate(), hal::VHDLParser::instantiate(), and hal::netlist_init().

◆ get_unique_grouping_id()

u32 hal::Netlist::get_unique_grouping_id ( )

Gets a spare grouping ID.
The value of 0 is reserved and represents an invalid ID.

Returns
The grouping ID.

Definition at line 658 of file netlist.cpp.

Referenced by create_grouping(), and hal::netlist_init().

◆ get_unique_module_id()

u32 hal::Netlist::get_unique_module_id ( )

Get a spare module ID.
The value of 0 is reserved and represents an invalid ID.

Returns
The module ID.

Definition at line 574 of file netlist.cpp.

Referenced by create_module(), hal::ActionCreateObject::exec(), and hal::netlist_init().

◆ get_unique_net_id()

u32 hal::Netlist::get_unique_net_id ( )

Get a spare net ID.
The value of 0 is reserved and represents an invalid ID.

Returns
The net ID.

Definition at line 320 of file netlist.cpp.

Referenced by create_net(), and hal::netlist_init().

◆ get_used_gate_ids()

std::set< u32 > hal::Netlist::get_used_gate_ids ( ) const

Get a set of all currently used gate IDs.

Returns
All 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().

◆ get_used_grouping_ids()

std::set< u32 > hal::Netlist::get_used_grouping_ids ( ) const

Get a set of all currently used grouping IDs.

Returns
All used grouping IDs.

Definition at line 831 of file netlist.cpp.

Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().

◆ get_used_module_ids()

std::set< u32 > hal::Netlist::get_used_module_ids ( ) const

Get a set of all currently used module IDs.

Returns
All 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().

◆ get_used_net_ids()

std::set< u32 > hal::Netlist::get_used_net_ids ( ) const

Get a set of all currently used net IDs.

Returns
All used net IDs.

Definition at line 771 of file netlist.cpp.

Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::netlist_init().

◆ get_vcc_gates()

const std::vector< Gate * > & hal::Netlist::get_vcc_gates ( ) const

Get all global VCC gates.

Returns
A vector of gates.

Definition at line 304 of file netlist.cpp.

Referenced by hal::VHDLParser::instantiate(), and hal::netlist_init().

◆ get_vcc_nets()

std::vector< Net * > hal::Netlist::get_vcc_nets ( ) const

Get all VCC nets in the netlist.

Returns
A vector of nets.

Definition at line 546 of file netlist.cpp.

Referenced by hal::NetlistModificationDecorator::create_vcc_net(), and hal::netlist_init().

◆ is_gate_in_netlist()

bool hal::Netlist::is_gate_in_netlist ( const Gate gate) const

◆ is_global_input_net()

bool hal::Netlist::is_global_input_net ( const Net net) const

Checks whether a net is a global input net.

Parameters
[in]net- The net to check.
Returns
True if the net is a global input net, false otherwise.

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().

◆ is_global_output_net()

bool hal::Netlist::is_global_output_net ( const Net net) const

Checks whether a net is a global output net.

Parameters
[in]net- The net to check.
Returns
True if the net is a global output net, false otherwise.

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().

◆ is_gnd_gate()

bool hal::Netlist::is_gnd_gate ( const Gate gate) const

Check whether a gate is a global GND gate.

Parameters
[in]gate- The gate to check.
Returns
True if the gate is a global GND gate, false otherwise.

Definition at line 299 of file netlist.cpp.

Referenced by mark_gnd_gate(), and hal::netlist_init().

◆ is_grouping_in_netlist()

bool hal::Netlist::is_grouping_in_netlist ( const Grouping grouping) const

Check whether the grouping is registered in the netlist.

Parameters
[in]grouping- The grouping to check.
Returns
True if the grouping is in the netlist, false otherwise.

Definition at line 686 of file netlist.cpp.

References test::n.

Referenced by hal::netlist_init().

◆ is_module_in_netlist()

bool hal::Netlist::is_module_in_netlist ( const Module module) const

Check whether the module is registered in the netlist.

Parameters
[in]module- The module to check.
Returns
True if the module is in the netlist, false otherwise.

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().

◆ is_net_in_netlist()

bool hal::Netlist::is_net_in_netlist ( const Net net) const

◆ is_vcc_gate()

bool hal::Netlist::is_vcc_gate ( const Gate gate) const

Check whether a gate is a global VCC gate.

Parameters
[in]gate- The gate to check.
Returns
True if the gate is a global VCC gate, false otherwise.

Definition at line 294 of file netlist.cpp.

Referenced by mark_vcc_gate(), and hal::netlist_init().

◆ load_gate_locations_from_data()

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.

Parameters
[in]data_category- The data category.
[in]data_identifiers- The data identifiers for the x- and y-coordinates.
Returns
True on success, false otherwise.

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().

◆ mark_global_input_net()

bool hal::Netlist::mark_global_input_net ( Net net)

Mark a net as a global input net.

Parameters
[in]net- The net.
Returns
True on success, false otherwise.

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().

◆ mark_global_output_net()

bool hal::Netlist::mark_global_output_net ( Net net)

Mark a net as a global output net.

Parameters
[in]net- The net.
Returns
True on success, false otherwise.

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().

◆ mark_gnd_gate()

bool hal::Netlist::mark_gnd_gate ( Gate gate)

Mark a gate as a global GND gate.

Parameters
[in]gate- The gate.
Returns
True on success, false otherwise.

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().

◆ mark_vcc_gate()

bool hal::Netlist::mark_vcc_gate ( Gate gate)

Mark a gate as a global VCC gate.

Parameters
[in]gate- The gate.
Returns
True on success, false otherwise.

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().

◆ operator!=()

bool hal::Netlist::operator!= ( const Netlist other) const

Check whether two netlists are unequal. Does not check netlist IDs.

Parameters
[in]other- The netlist to compare against.
Returns
True if both netlists are unequal, false otherwise.

Definition at line 70 of file netlist.cpp.

References operator==().

◆ operator==()

bool hal::Netlist::operator== ( const Netlist other) const

Check whether two netlists are equal. Does not check netlist IDs.

Parameters
[in]other- The netlist to compare against.
Returns
True if both netlists are equal, false otherwise.

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!=().

◆ set_design_name()

void hal::Netlist::set_design_name ( const std::string &  name)

Set the name of the design.

Parameters
[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().

◆ set_device_name()

void hal::Netlist::set_device_name ( const std::string &  name)

Set the name of the target device.

Parameters
[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().

◆ set_free_gate_ids()

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.

Parameters
[in]ids- All freed gate IDs.

Definition at line 756 of file netlist.cpp.

Referenced by hal::netlist_init().

◆ set_free_grouping_ids()

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.

Parameters
[in]ids- All freed grouping ids.

Definition at line 846 of file netlist.cpp.

Referenced by hal::netlist_init().

◆ set_free_module_ids()

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.

Parameters
[in]ids- All freed module IDs.

Definition at line 816 of file netlist.cpp.

Referenced by hal::netlist_init().

◆ set_free_net_ids()

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.

Parameters
[in]ids- All freed net IDs.

Definition at line 786 of file netlist.cpp.

Referenced by hal::netlist_init().

◆ set_id()

void hal::Netlist::set_id ( const u32  id)

Set the ID of the netlist to the specified value.

Parameters
[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().

◆ set_input_filename()

void hal::Netlist::set_input_filename ( const std::filesystem::path &  path)

Set the path to the input file.

Parameters
[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().

◆ set_next_gate_id()

void hal::Netlist::set_next_gate_id ( const u32  id)

Set the gate ID following the highest currently used ID.

Parameters
[in]id- The next gate ID.

Definition at line 736 of file netlist.cpp.

References id.

Referenced by hal::netlist_init().

◆ set_next_grouping_id()

void hal::Netlist::set_next_grouping_id ( const u32  id)

Set the grouping ID following the highest currently used ID.

Parameters
[in]id- The next grouping ID.

Definition at line 826 of file netlist.cpp.

References id.

Referenced by hal::netlist_init().

◆ set_next_module_id()

void hal::Netlist::set_next_module_id ( const u32  id)

Set the module ID following the highest currently used ID.

Parameters
[in]id- The next module id.

Definition at line 796 of file netlist.cpp.

References id.

Referenced by hal::netlist_init().

◆ set_next_net_id()

void hal::Netlist::set_next_net_id ( const u32  id)

Set the net ID following the highest currently used ID.

Parameters
[in]id- The next net ID.

Definition at line 766 of file netlist.cpp.

References id.

Referenced by hal::netlist_init().

◆ set_used_gate_ids()

void hal::Netlist::set_used_gate_ids ( const std::set< u32 ids)

Set a set of all currently used gate IDs.

Parameters
[in]ids- All used gate IDs.

Definition at line 746 of file netlist.cpp.

Referenced by hal::netlist_init().

◆ set_used_grouping_ids()

void hal::Netlist::set_used_grouping_ids ( const std::set< u32 ids)

Set a set of all currently used grouping IDs.

Parameters
[in]ids- All used grouping IDs.

Definition at line 836 of file netlist.cpp.

Referenced by hal::netlist_init().

◆ set_used_module_ids()

void hal::Netlist::set_used_module_ids ( const std::set< u32 ids)

Set a set of all currently used module IDs.

Parameters
[in]ids- All used module IDs.

Definition at line 806 of file netlist.cpp.

Referenced by hal::netlist_init().

◆ set_used_net_ids()

void hal::Netlist::set_used_net_ids ( const std::set< u32 ids)

Set a set of all currently used net IDs.

Parameters
[in]ids- All used net IDs.

Definition at line 776 of file netlist.cpp.

Referenced by hal::netlist_init().

◆ unmark_global_input_net()

bool hal::Netlist::unmark_global_input_net ( Net net)

Unmark a global input net.

Parameters
[in]net- The net.
Returns
True on success, false otherwise.

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().

◆ unmark_global_output_net()

bool hal::Netlist::unmark_global_output_net ( Net net)

Unmark a global output net.

Parameters
[in]net- The net.
Returns
True on success, false otherwise.

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().

◆ unmark_gnd_gate()

bool hal::Netlist::unmark_gnd_gate ( Gate gate)

Unmark a global GND gate.

Parameters
[in]gate- The gate.
Returns
True on success, false otherwise.

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().

◆ unmark_vcc_gate()

bool hal::Netlist::unmark_vcc_gate ( Gate gate)

Unmark a global VCC gate.

Parameters
[in]gate- The gate.
Returns
True on success, false otherwise.

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().

Friends And Related Function Documentation

◆ NetlistInternalManager

friend class NetlistInternalManager
friend

Definition at line 57 of file netlist.h.

Referenced by Netlist().


The documentation for this class was generated from the following files: