ConnectPointList¶
- class util.ConnectPointList.ConnectPointList(sizex=None, sizey=None, point=None)[source]¶
This stores list of connection points
Methods:
Sets cursor at given x, y coordinate
Set color to all the points in the connection list
Stores all points and its attributes in csv format in the file
This fucntion checks following
Loads all points and its attributes from the given csv file
This method loads points from the SVG file.
Search for connection going out of this point
Search for connection coming into this point
Push given connection one-level down
Pull given connections one-level up
Make connection with the top layer
Resets the level of the connections
Holds the cursor at current position
Releases cursor and moves with each point addition
Flips all the points horizontally or vertically
This method splits all the connections longer that
max_distance
to at maxmax_distance
lengthCrops all the connections going out of grid
trim_borders
Returns networksx object of the given connection point list
Merges different ConnectPointList together into one Connect Point List
Scales the connect point list from an anchor position
Moves the connect point list in x y coordinates
Rotates the connect point list at right angles
Adds the next point in the connect point list
Places the cursor on the specified x coordinate without connection
Places the cursor on the specified y coordinate without connection
Moves cursor in x direction by specified steps times by specified value
Moves cursor in y direction by specified steps times by specified value
Adds a connect point in the connect point list
Creates a new connection at the given from and to points and add it to the connect point list
This renderes connection points list in a SVG format
Return reference for the given tile location
Return reference for the given tile location
Returns the instance from top_level design
This print ports generation statistics
Extracts the connectivity statistics for port and connection creation
Create feedthrough port on the given module
Performs top level connection using connection file
Prints mapping beetween grid cordinates and top level instances
Prints mapping beetween grid cordinates and top level instance refereneces
Short all the incoming connections to this point with outgoing connections
Attributes:
Returns list of ConnectionPoints
Returns current location of cursor
Returns location of cursor
returns y location of cursor
- 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.
- 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
- 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 maxmax_distance
length- Parameters
max_distance (int) – int to sample the connection at this value
- 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
- 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
- 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
- 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
- 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
- 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
- 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_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
- 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