ConnectPointList

class util.ConnectPointList.ConnectPointList(sizex=None, sizey=None, point=None)[source]

This stores list of connection points

Methods:

__init__

set_cursor

Sets cursor at given x, y coordinate

set_color

Set color to all the points in the connection list

store_points

Stores all points and its attributes in csv format in the file

validate_connectivity

This fucntion checks following

load_points

Loads all points and its attributes from the given csv file

load_points_from_svg

This method loads points from the SVG file.

search_from_point

Search for connection going out of this point

search_to_point

Search for connection coming into this point

push_connection_down

Push given connection one-level down

pull_connection_up

Pull given connections one-level up

make_top_connection

Make connection with the top layer

reset_level

Resets the level of the connections

hold_cursor

Holds the cursor at current position

release_cursor

Releases cursor and moves with each point addition

flip

Flips all the points horizontally or vertically

sample_connections

This method splits all the connections longer that max_distance to at max max_distance length

crop_edges

Crops all the connections going out of grid

trim_borders

create_graph

Returns networksx object of the given connection point list

merge

Merges different ConnectPointList together into one Connect Point List

scale

Scales the connect point list from an anchor position

translate

Moves the connect point list in x y coordinates

rotate

Rotates the connect point list at right angles

add_next_point

Adds the next point in the connect point list

move_cursor_x

Places the cursor on the specified x coordinate without connection

move_cursor_y

Places the cursor on the specified y coordinate without connection

move_x

Moves cursor in x direction by specified steps times by specified value

move_y

Moves cursor in y direction by specified steps times by specified value

add_connect_point

Adds a connect point in the connect point list

add_connection

Creates a new connection at the given from and to points and add it to the connect point list

render_pattern

This renderes connection points list in a SVG format

get_reference

Return reference for the given tile location

get_top_instance

Return reference for the given tile location

get_top_instance_name

Returns the instance from top_level design

print_port_stat

This print ports generation statistics

show_stats

Extracts the connectivity statistics for port and connection creation

create_ft_ports

Create feedthrough port on the given module

create_ft_connection

Performs top level connection using connection file

print_instance_grid_map

Prints mapping beetween grid cordinates and top level instances

print_reference_grid_map

Prints mapping beetween grid cordinates and top level instance refereneces

short_through

Short all the incoming connections to this point with outgoing connections

Attributes:

points

Returns list of ConnectionPoints

cursor

Returns current location of cursor

get_x

Returns location of cursor

get_y

returns y location of cursor

__init__(sizex=None, sizey=None, point=None)[source]
property points

Returns list of ConnectionPoints

property cursor

Returns current location of cursor

property get_x

Returns location of cursor

property get_y

returns y location of cursor

set_cursor(x, y)[source]

Sets cursor at given x, y coordinate

Parameters
  • x (int) – point on the x-axis where cursor is to be placed

  • y (int) – point on the y-axis where cursor is to be placed

Returns

self ConnectionPointList object

Return type

self

set_color(color)[source]

Set color to all the points in the connection list

Parameters

color (str) – Specify a color for connect point list e.g ‘red’, ‘blue’, ‘green’, etc.

store_points(filename)[source]

Stores all points and its attributes in csv format in the file

validate_connectivity()[source]

This fucntion checks following

  • If there is any connection coming outside from range (0-sizex+1) or (0-sizey+1)

  • If there is any redundant connections

load_points(filename, append=False, delimiter=' ', skiplines=3)[source]

Loads all points and its attributes from the given csv file

Format: from_x, from_y, to_x, to_y, level, color

load_points_from_svg(filename, grid=13.8, group='markers', append=False, same_color='black', down_color='red', up_color='green')[source]

This method loads points from the SVG file. enabling UI based designing of connection file.

search_from_point(point)[source]

Search for connection going out of this point

Note: Returns the first point

Parameters

point (tuple) – Point to search

Return type

ConnectionPoint

search_to_point(point)[source]

Search for connection coming into this point

Note: Returns the first point

Parameters

point (tuple) – Point to search

Return type

ConnectionPoint

push_connection_down(point)[source]

Push given connection one-level down

‘Push down’ connection indicates that this connection is going down from the current level

Parameters

point (tuple) – Connetion point to push down

Return type

ConnectionPoint

pull_connection_up(point)[source]

Pull given connections one-level up

‘Pull up’ connection indicates that this connection is coming from one level above this level

Parameters

point (tuple) – Connetion point to pull up

make_top_connection(point)[source]

Make connection with the top layer

Parameters

point (tuple) – Connetion point to push down

Return type

ConnectionPoint

reset_level(point)[source]

Resets the level of the connections

Parameters

point (ConnectPoint) – It is a ConnectPoint object

hold_cursor()[source]

Holds the cursor at current position

release_cursor()[source]

Releases cursor and moves with each point addition

flip(orientation='H')[source]

Flips all the points horizontally or vertically

Parameters

orientation – “H” or “V” (default=”H”)

sample_connections(max_distance=1)[source]

This method splits all the connections longer that max_distance to at max max_distance length

Parameters

max_distance (int) – int to sample the connection at this value

crop_edges()[source]

Crops all the connections going out of grid

create_graph()[source]

Returns networksx object of the given connection point list

Returns

Returns networkx object of the given ConnectionPointList

Return type

nx.DiGraph

merge(connectlist)[source]

Merges different ConnectPointList together into one Connect Point List

Parameters

connectlist (ConnectPointList) – provide with a ConnectPointList

Returns

Return self object

Return type

ConnectPointList

scale(scale, anchor=(0, 0))[source]

Scales the connect point list from an anchor position

Parameters
  • scale – scale at which ConnectPointList is expanded

  • anchor – (x,y) coordinates of an anchor point

Returns

Return self object

Return type

ConnectPointList

translate(x, y)[source]

Moves the connect point list in x y coordinates

Parameters
  • x (int) – Steps in x-axis

  • y (int) – Steps in y-axis

rotate(angle=0)[source]

Rotates the connect point list at right angles

Parameters

angle (int) – degree of rotations (0, 90, 180, 270, -90, -180, -270)

Returns

Return self object

Return type

ConnectPointList

add_next_point(x, y)[source]

Adds the next point in the connect point list

Parameters
  • x – next point x-axis coordinate

  • y – next point y-axis coordinate

Returns

Return new added point

Return type

ConnectPoint

move_cursor_x(value=1)[source]

Places the cursor on the specified x coordinate without connection

Parameters

value – steps cursor moves in the x-axis

move_cursor_y(value=1)[source]

Places the cursor on the specified y coordinate without connection

Parameters

value – steps cursor moves in the y-axis

move_x(value=1, steps=1, color=' black')[source]

Moves cursor in x direction by specified steps times by specified value

Parameters
  • value – specified value by which cursor moves in the x-axis

  • steps – times cursor is moved

  • color – specify the color of this connection e.g red, blue, green, etc.

Returns

Return self object

Return type

ConnectPointList

move_y(value=1, steps=1, color=' black')[source]

Moves cursor in y direction by specified steps times by specified value

Parameters
  • value – specified value by which cursor moves in the y-axis

  • steps – times cursor is moved

  • color – specify the color of this connection e.g red, blue, green, etc.

Returns

return self object

Return type

self

add_connect_point(point)[source]

Adds a connect point in the connect point list

Parameters

point (ConnectPoint) – It is a cConnectPoint object

Returns

Returns new ConnectPoint

Return type

ConnectPoint

add_connection(from_x, from_y, to_x, to_y)[source]

Creates a new connection at the given from and to points and add it to the connect point list

Parameters
  • from_x (int) – point on x coordinate from which connection starts

  • from_y (int) – point on y coordinate from which connection starts

  • to_x (int) – point on x coordinate where connection ends

  • to_y (int) – point on y coordinate where connection ends

Returns

New ConnectionPoint object

Return type

ConnectionPoint

render_pattern(scale=20)[source]

This renderes connection points list in a SVG format

Parameters

connect (list) – collection connection pattern

Returns

return svg string

Return type

str(str)

get_reference(netlist, x, y)[source]

Return reference for the given tile location

get_top_instance(netlist: spydrnet.ir.Netlist, x, y)[source]

Return reference for the given tile location

Returns

Returns SpyDrNet instance

Return type

sdn.Instance

get_top_instance_name(x, y)[source]

Returns the instance from top_level design

Returns

Instance name

Return type

str

print_port_stat(netlist, filename=None)[source]

This print ports generation statistics

show_stats(netlist)[source]

Extracts the connectivity statistics for port and connection creation

create_ft_ports(netlist: spydrnet.ir.Netlist, port_name: str, cable: spydrnet.ir.Cable)[source]

Create feedthrough port on the given module

Parameters
  • netlist (Netlist) – netlist

  • port (str) – port name on each module

create_ft_connection(netlist: spydrnet.ir.Netlist, signal_cable: spydrnet.ir.Instance, down_port=None, up_port=None, top_cable=None)[source]

Performs top level connection using connection file

Parameters
  • netlist (sdn.Netlist) – Top level netlist

  • signal_cable (str) – Current level signal port

  • down_port (str) – Name of down level port

print_instance_grid_map()[source]

Prints mapping beetween grid cordinates and top level instances

print_reference_grid_map(netlist: spydrnet.ir.Netlist)[source]

Prints mapping beetween grid cordinates and top level instance refereneces

short_through(through_point)[source]

Short all the incoming connections to this point with outgoing connections

Note: Connects the last found incoming and outgoing point in the list

Parameters

through_point (tuple) – point to short through