Port

class spydrnet_physical.ir.port.Port(name=None, properties=None, is_downto=None, is_scalar=None, lower_index=None, direction=None)[source]

Bases: spydrnet.ir.port.Port

This class extends the default Port class

Methods:

__init__

Setup an empty port

split

add_pin

Add a pin to the port at the given position.

change_name

Change name of the port and corrosponding cable

clone

Clone the port in an api safe way.

create_pin

Create a pin and add it to the port.

create_pins

Create pin_count pins in the given port a downto style syntax is assumed.

get

get the item from the data structure

get_cables

Shortcut to get_cables().

get_definitions

Shortcut to get_definitions().

get_hcables

Shortcut to get_hcables().

get_hinstances

Shortcut to get_hinstances().

get_hpins

Shortcut to get_hpins().

get_hports

Shortcut to get_hports().

get_hwires

Shortcut to get_hwires().

get_index

Returns the python index of element

get_instances

Shortcut to get_instances().

get_libraries

Shortcut to get_libraries().

get_netlists

Shortcut to get_netlists().

get_pins

Shortcut to get_pins().

get_ports

Shortcut to get_ports().

get_verilog_index

Returns the verilog index of element

get_wires

Shortcut to get_wires().

pop

pop the object from the data structure

remove_pin

Remove the given pin from the port.

remove_pins_from

Remove several pins from the port at once.

somhing

Attributes:

is_input

is_output

is_inout

size

Returns number of pins in the port

data

Data stores information about the element

definition

Get the definition that this bundle belongs to.

direction

Gets the direction of the port.

is_array

This is the logical inverse of is_scalar.

is_downto

Get the downto status of the bundle.

is_scalar

Return True if the item is a scalar False otherwise.

lower_index

Get the value of the lower index of the array.

name

The name of this element

pins

Get a list of the pins that are in the port

properties

Returns properties of the object

Classes:

Direction

Define the possible directions for a given port.

__init__(name=None, properties=None, is_downto=None, is_scalar=None, lower_index=None, direction=None)[source]

Setup an empty port

Parameters
  • name - (str) the name of this instance

  • properties - (dict) the dictionary which holds the properties

  • id_downto - (bool) set the downto status. Downto is False if the right index is higher than the left one, True otherwise

  • is_scalar - (bool) set the scalar status. Return True if the item is a scalar False otherwise.

  • lower_index - (int) get the value of the lower index of the array.

  • direction - (Enum) Define the possible directions for a given port. (UNDEFINED, INOUT, IN, OUT)

property size

Returns number of pins in the port

Returns

Returns size of port

Return type

int

change_name(name)[source]

Change name of the port and corrosponding cable

Parameters

name (str) – Name of the ports