prga.prog.common module

class prga.prog.common.AbstractProgCircuitryEntry

Bases: prga.util.Object

Abstract base class for programming circuitry entry point.

classmethod _get_or_create_prog_nets(module, excludes=None)
classmethod buffer_prog_ctrl(context, design_view=None, _cache=None)

Buffer and balance basic programming ctrl signals: prog_clk, prog_rst and prog_done.

Parameters:
  • context (Context) –
  • design_view (Module) – This method inserts the programming ctrl signals recursively into sub-modules of design_view. It starts with context.top by default.
  • _cache (MutableMapping [Hashable, int]) – Mapping from module keys to levels of buffering inside the corresponding modules
Returns:

Levels of buffering of prog_rst and prog_done

Return type:

int

classmethod insert_prog_circuitry(context, *args, **kwargs)

Insert programming circuitry into the FPGA. This method will be called by the ProgCircuitryInsertion pass.

Parameters:context (Context) –
classmethod materialize(ctx, inplace=False, **kwargs)

Materialize the abstract context to this configuration circuitry type.

Parameters:
  • ctx (Context) – An abstract context, or a context previously materialized to another configuration circuitry type.
  • inplace (bool) – If set, the context is modified in-place. Otherwise (by default), ctx is deep-copied before processed
Keyword Arguments:
 

**kwargs – Additional keyword parameters specific to the programming circuitry type.

Returns:

Return type:

Context

class prga.prog.common.ProgDataBitmap(args)

Bases: object

_bitmap
_construct(args)
length

Length of the bitmap.

Type:int
query(offset, length)

Query how offset +: length should be mapped.

Parameters:
  • offset (int) – Source offset
  • length (int) –
Yields:

ProgDataRange – Destination offset and length

remap(bitmap, *, inplace=False)

Remap self onto bitmap.

Parameters:bitmap (ProgDataBitmap) –
Keyword Arguments:
 inplace (bool) –
Returns:
Return type:ProgDataBitmap
class prga.prog.common.ProgDataRange(offset, length)

Bases: tuple

_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('offset', 'length')
_fields_defaults = {}
classmethod _make(iterable)

Make a new ProgDataRange object from a sequence or iterable

_replace(**kwds)

Return a new ProgDataRange object replacing specified fields with new values

length

Alias for field number 1

offset

Alias for field number 0

class prga.prog.common.ProgDataValue(value, args)

Bases: object

bitmap
breakdown()

Break bitmapped value into multiple simple values.

Yields:tuple [int, ProgDataRange ] – value and range
remap(bitmap, *, inplace=False)

Remap this value onto bitmap.

Parameters:bitmap (ProgDataBitmap) –
Keyword Arguments:
 inplace (bool) –
Returns:
Return type:ProgDataValue
value