prga.core.builder.array.tile module

class prga.core.builder.array.tile.TileBuilder(context, module)

Bases: prga.core.builder.array.base.BaseArrayBuilder

Tile builder.

Parameters:
  • context (Context) – The context of the builder
  • module (Module) – The module to be built
classmethod _expose_blockpin(pin)

Expose a block pin as a BlockPinID node.

auto_connect()

Automatically connect submodules.

Returns:
Return self to support chaining, e.g.,
array = builder.fill().auto_connect().commit()
Return type:TileBuilder
build_connection_box(ori, offset, **kwargs)

Build the connection box at the specific position. Corresponding connection box instance is created and added to this tile if it’s not already added into the tile.

Parameters:
  • ori (Orientation or str) – Orientation of the connection box
  • offset (int) – Offset of the connection box in the specified orientation
Keyword Arguments:
 

**kwargs – Additional attributes assigned to the connection box module

Returns:

Return type:

ConnectionBoxBuilder

Note

Connection boxes are indexed as the following:

    0   1   2   3
  +---------------+
2 |     north     | 2
1 | west     east | 1
0 |     south     | 0
  +---------------+
    0   1   2   3
fill(default_fc, *, fc_override=None)

Fill connection boxes in the array.

Parameters:default_fc – Default FC value for all blocks whose FC value is not defined. If one single int or float is given, this FC value applies to all ports of all blocks. If a tuple of two int`s or :obj:`float`s are given, the first one applies to all input ports while the second one applies to all output ports. Use `BlockFCValue for more custom options.
Keyword Arguments:
 fc_override (Mapping) – Override the FC settings for specific blocks. Indexed by block key.
Returns:
Return self to support chaining, e.g.,
array = builder.fill().auto_connect().commit()
Return type:TileBuilder
instantiate(model, reps=None, *, name=None, **kwargs)

Instantiate model in the tile.

Parameters:
  • model (Module) – Abstract view of a logic/IO block to be instantiated
  • reps (int) – If set to a positive int, the specified number of instances are created, added to the tile, and returned. This affects the capacity attribute in the output VPR specs
Keyword Arguments:
 
  • name (str) – Name of the instance. If not specified, "lb_i{subtile_id}" is used by default. If reps and name are both specified, each instance is then named "{name}_i{index}".
  • **kwargs – Additional attributes assigned to each instance
Returns:

Return type:

Instance or tuple [Instance ]

classmethod new(name, width, height, *, disallow_segments_passthru=False, edge=OrientationTuple(north=False, east=False, south=False, west=False), **kwargs)

Create a new tile.

Parameters:
  • name (str) – Name of the tile
  • width (int) – Width of the tile
  • height (int) – Height of the tile
Keyword Arguments:
 
  • disallow_segments_passthru (bool) – If set to True, segments are not allowed to run over the tile
  • edge (OrientationTuple [bool ]) – Marks this tile to be on the specified edges of the top-level array. This affects segment instantiation.
  • **kwargs – Additional attributes assigned to the tile
Returns:

Return type:

Module