prga.tools.ioplan.ioplan module

class prga.tools.ioplan.ioplan.IOPlanner(summary, start_pos=(0, 0), subtile=0, counterclockwise=False)

Bases: prga.util.Object

Helper class for creating I/O constraints.

Parameters:
  • summary (Context or ContextSummary) –
  • start_pos (tuple [int, int ]) – Starting position for auto-planning
  • start_subtile (int) – Starting subtile for auto-planning
  • counterclockwise (bool) – If set, auto-plan IO in counter-clockwise order.
_IOPlanner__next_position()
_reprog_bit = re.compile('^(?P<out>out:)?(?P<name>.*?)(?:\\[(?P<index>\\d+)\\])?$')
classmethod autoplan(summary, app, *, random=False)

Automatically generate IO constraints and write into app.

Parameters:
Keyword Arguments:
 

random (bool) – If set, IOs are assigned randomly

avail_globals
avail_nonglobals
counterclockwise
globals_
classmethod parse_io_constraints(app, f)

Parse a partial or complete IO constraint file.

Parameters:
  • app (AppIntf) – Interface of the application.
  • f (str of file-like object) –
pop(direction, *, random=False, force_change_tile=False, use_global_driver_as_normal=False)

Pop the next available IO of for direction.

Parameters:

direction (PortDirection or str) –

Keyword Arguments:
 
  • random (bool) – If set, pop a random IO instead of the next one in the scanning
  • force_change_tile (bool) – If set, the scanning will start from a new tile. This is useful when trying to reduce routing congestion
  • use_global_driver_as_normal (bool) – If set, global driver I/O pins are used as regular IO pins
Returns:

Return type:

tuple [Position, int ]

position
classmethod print_io_constraints(app, ostream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)

Print IO constraints.

Parameters:
  • app (AppIntf) – Interface of the application.
  • ostream (str or file-like object) –
reset_scanning(position=None, subtile=None, counterclockwise=None)

Reset scanning pointer.

Parameters:
  • position (tuple [int, int ]) –
  • subtile (int) –
  • counterclockwise (bool) –
subtile
use(direction, position, subtile)

Mark the IO at the specified location as used.

Parameters:
  • direction (PortDirection or str) –
  • position (tuple [int, int ]) –
  • subtile (int) –
used
xmax
ymax