QNet

class QNet[source]

Use DataFrame to hold Net Information about the connected pins of a design.

There is one unique net_id for each connected pin.

Hold the net information of all the USED pins within a design.

Attributes

net_info

Provide table of all nets within the design.

Returns:

Table of the net of pins within design.

Return type:

pd.DataFrame

qnet_latest_assigned_id

Return unique number for each net in table.

Returns:

For user of the design class to know the lastest id added to _net_info.

Return type:

int

Methods

add_pins_to_table(comp1_id: int, pin1_name: str, comp2_id: int, pin2_name: str) int[source]

Add two entries into the _net_info table. If either component/pin is already in net_info, the connection will NOT be added to the net_info.

Parameters:
  • comp1_id (int) – Name of component 1.

  • pin1_name (str) – Corresponding pin name for component1.

  • comp2_id (int) – Name of component 2.

  • pint2 (str) – Corresponding pin name for component2.

Returns:

0 if not added to list, otherwise the net_id

Return type:

int

delete_all_pins_for_component(component_id_to_remove: int) set[source]

Delete all the pins for a given component id.

Parameters:

component_id_to_remove (int) – Component ID to remove

Returns:

All deleted ids

Return type:

set

delete_net_id(net_id_to_remove: int)[source]

Removes the two entries with net_id_to_remove. If id is in _net_info, the entry will be removed.

Parameters:

net_id_to_remove (int) – The id to remove.

get_components_and_pins_for_netid(net_id_search: int) DataFrame[source]

Search with a net_id to get component id and pin name.

Parameters:

net_id_search (int) – Unique net id which connects two pins within a design.

Returns:

Two rows of the net_info which have the same net_id_search.

Return type:

pandas.DataFrame