FPGA Reference

AMD (Xilinx)

Xilinx FPGA clocking model.

class adijif.fpgas.xilinx.xilinx(model: None | CpoModel = None, solver: str | None = None)

Bases: xilinx_bf, xilinx_draw

Xilinx FPGA clocking model.

This model captures different limitations of the Xilinx PLLs and interfaces used for JESD.

Currently only Zynq 7000 devices have been fully tested.

determine_pll(bit_clock: int, fpga_ref_clock: int) Dict

Determine if configuration is possible with CPLL or QPLL.

CPLL is checked first and will check QPLL if that case is invalid.

This is only used for brute-force implementations.

Args:

bit_clock (int): Equivalent to lane rate in bits/second fpga_ref_clock (int): System reference clock

Returns:

Dict: Dictionary of PLL configuration

property device_clock_and_ref_clock_relation: str

Get device clock and reference clock relation.

Device clock and reference clock relation can be set to: - NA: No relation - ref_clock_2x_device_clock: Reference clock is 2x device clock - ref_clock_eq_device_clock: Reference clock is equal to device clock

Returns:

str: Device clock and reference clock relation.

property device_clock_source: str

Get device clock source.

Device clock source can be set to: - external: External clock from clock chip - link_clock: Link layer clock is reused for as device clock - ref_clock: Reference clock is reused for device clock

Returns:

str: Device clock source.

force_cpll = False

Force all transceiver sources to be from a single PLL quad. This will try to leverage the output dividers of the PLLs

force_qpll = False

Force use of QPLL1 for transceiver source (GTHE3,GTHE4,GTYE4)

force_qpll1 = False

Force use of CPLL for transceiver source

force_separate_device_clock: bool = False

Constrain reference clock to be specific values. Options: - CORE_CLOCK: Make reference clock the same as the core clock (LR/40 or LR/66) - CORE_CLOCK_DIV2: Make reference clock the same as the core clock divided by 2 - Unconstrained: No constraints on reference clock. Simply meet PLL constraints

force_single_quad_tile = False

Request that clock chip generated device clock device clock == LMFC/40 NOTE: THIS IS NOT FPGA REF CLOCK

fpga_generation() str

Get FPGA generation 7000, US, US+… based on transceiver type.

Returns:

str: FPGA generation

Raises:

Exception: Unknown transceiver generation

get_config(converter: converter, fpga_ref: float | int, solution: CpoSolveResult | None = None) List[Dict] | Dict

Extract configurations from solver results.

Collect internal FPGA configuration and output clock definitions.

Args:
converter (conv): Converter object connected to FPGA who config is

collected

fpga_ref (int or float): Reference clock generated for FPGA for specific

converter

solution (CpoSolveResult): CPlex solution and only needed for CPlex

solver

Returns:

Dict: Dictionary of clocking rates and dividers for configuration.

Raises:

Exception: Invalid PLL configuration.

get_required_clock_names() List[str]

Get list of strings of names of requested clocks.

This list of names is for the clocks defined by get_required_clocks

Returns:

List[str]: List of strings of clock names in order

Raises:
Exception: Clock have not been enumerated aka get_required_clocks not

not called yet.

get_required_clocks(converter: converter, fpga_ref: int | None | CpoIntVar, link_out_ref: int | None | CpoIntVar = None) List

Get necessary clocks for QPLL/CPLL configuration.

Args:
converter (conv): Converter object of converter connected to

FPGA

fpga_ref (int, GKVariable, GK_Intermediate, GK_Operators, CpoIntVar):

Abstract or concrete reference to FPGA reference clock

link_out_ref (int or GKVariable): Reference clock generated for FPGA

link layer output, also called device clock

Returns:

List: List of solver variables and constraints

Raises:

Exception: If solver is not valid Exception: Link layer out clock required

minimize_fpga_ref_clock = False

Force generation of separate device clock from the clock chip. In many cases, the ref clock and device clock can be the same.

property out_clk_select: int | float

Get current PLL clock output mux options for link layer clock.

Valid options are: “XCVR_REFCLK”, “XCVR_REFCLK_DIV2”, “XCVR_PROGDIV_CLK” If a list of these is provided, the solver will determine one to use.

Returns:

str, list(str): Mux selection for link layer clock.

property ref_clock_constraint: str

Get reference clock constraint.

Reference clock constraint can be set to: - CORE_CLOCK: Make reference clock the same as the core clock (LR/40 or LR/66) - CORE_CLOCK_DIV2: Make reference clock the same as the core clock divided by 2 - Unconstrained: No constraints on reference clock. Simply meet PLL constraints

Returns:

str: Reference clock constraint.

setup_by_dev_kit_name(name: str) None

Configure object based on board name. Ex: zc706, zcu102.

Args:

name (str): Name of dev kit. Ex: zc706, zcu102

Raises:

Exception: Unsupported board requested.

target_Fmax = 500000000.0

Device and reference clock relation

trx_gen() int

Get transceiver generation (2,3,4).

Returns:

int: generation of transceiver

trx_variant() str

Get transceiver variant (GTX, GTH, GTY, …).

Returns:

str: Transceiver variant

AMD (Xilinx) Transceivers

AMD (Xilinx) 7 Series Transceivers

7 series transceiver model.

class adijif.fpgas.xilinx.sevenseries.CPLL(parent_transceiver: CpoModel)

Bases: PLLCommon

Channel PLL (CPLL) for 7 series FPGAs.

property D: int | List[int]

Get the D value for the CPLL.

property M: int | List[int]

Get the M value for the CPLL.

property N1: int | List[int]

Get the N1 value for the CPLL.

property N2: int | List[int]

Get the N2 value for the CPLL.

add_constraints(config: dict, fpga_ref: int | CpoIntVar, converter: converter) dict

Add Channel PLL (CPLL) constraints.

Args:

config (dict): Configuration dictionary. fpga_ref (int, CpoIntVar): FPGA reference clock. converter (conv): Converter object.

Returns:

dict: Updated configuration dictionary.

get_config(config: dict, converter: converter, fpga_ref: int | CpoIntVar) dict

Get CPLL configuration.

Args:

config (dict): Configuration dictionary. converter (conv): Converter object. fpga_ref (int, CpoIntVar): FPGA reference clock.

Returns:

dict: Updated configuration dictionary.

property vco_max: int

Get the maximum VCO frequency for the transceiver type.

Returns:

int: Maximum VCO frequency.

Raises:

Exception: Unsupported transceiver type.

property vco_min: int

Get the minimum VCO frequency for the transceiver type.

Returns:

int: Minimum VCO frequency.

Raises:

Exception: Unsupported transceiver type.

class adijif.fpgas.xilinx.sevenseries.QPLL(parent_transceiver: CpoModel)

Bases: PLLCommon

QPLL for 7 series FPGAs.

property D: int | List[int]

Get the D value for the QPLL.

property M: int | List[int]

Get the M value for the QPLL.

property N: int | List[int]

Get the N value for the QPLL.

add_constraints(config: dict, fpga_ref: int | CpoIntVar, converter: converter) dict

Add constraints for QPLL for 7 series FPGAs.

Args:

config (dict): Configuration dictionary. fpga_ref (int, CpoIntVar): FPGA reference clock. converter (conv): Converter object.

Returns:

dict: Updated configuration dictionary.

Raises:

Exception: Unsupported transceiver type.

get_config(config: dict, converter: converter, fpga_ref: int | float) dict

Get QPLL configuration for 7 series FPGAs.

Args:

config (dict): Configuration dictionary. converter (conv): Converter object. fpga_ref (Union[int, float]): FPGA reference clock.

Returns:

dict: Updated configuration dictionary.

property vco_max: int

Get the maximum VCO frequency for the transceiver type.

Returns:

int: Maximum VCO frequency.

Raises:

Exception: Unsupported transceiver type.

property vco_min: int

Get the minimum VCO frequency for the transceiver type.

Returns:

int: Minimum VCO frequency.

Raises:

Exception: Unsupported transceiver type.

class adijif.fpgas.xilinx.sevenseries.SevenSeries(parent=None, speed_grade: str | None = '-2', transceiver_type: str | None = 'GTXE2', *args, **kwargs)

Bases: XilinxPLL

7 series Transceiver model.

add_constraints(config: dict, fpga_ref: CpoIntVar | None | int, converter: converter) dict

Add constraints for PLLs.

Args:

config (dict): Configuration dictionary. fpga_ref (int, CpoIntVar): FPGA reference clock. converter (conv): Converter object.

Returns:

dict: Updated configuration dictionary.

add_plls() None

Add PLLs to the model.

get_config(config: dict, converter: converter, fpga_ref: int | float) dict

Get PLL configuration.

Args:

config (dict): Configuration dictionary. converter (conv): Converter object. fpga_ref (Union[int, float]): FPGA reference clock.

Returns:

dict: Updated configuration dictionary.

AMD (Xilinx) UltraScale+ Transceivers

Ultrascale+ PLLs transceiver models.

class adijif.fpgas.xilinx.ultrascaleplus.CPLL(parent_transceiver: CpoModel)

Bases: CPLL

CPLL model for Ultrascale+ transceivers.

property vco_max: int

Get the VCO max frequency in Hz for CPLL.

property vco_min: int

Get the VCO min frequency in Hz for CPLL.

class adijif.fpgas.xilinx.ultrascaleplus.QPLL(parent_transceiver: CpoModel)

Bases: QPLL

QPLL model for Ultrascale+ transceivers.

property QPLL_CLKOUTRATE: int

Get the QPLL_CLKOUTRATE value.

property QPLL_CLKOUTRATE_available: List[int]

Get the QPLL_CLKOUTRATE available values.

property SDMDATA_max: int

Get the SDMDATA_max value.

property SDMDATA_min: int

Get the SDMDATA_min value.

property SDMWIDTH: int

Get the SDMWIDTH value.

add_constraints(config: dict, fpga_ref: int | None | CpoIntVar, converter: converter) dict

Add constraints for the Transceiver.

Args:

config (dict): Configuration dictionary. fpga_ref (int, CpoIntVar): FPGA reference clock. converter (conv): Converter object.

Returns:

dict: Updated configuration dictionary.

get_config(config: dict, converter: converter, fpga_ref: int | float) dict

Get the configuration of the QPLL.

Args:

config (dict): Configuration dictionary. converter (conv): Converter object. fpga_ref (int, float): FPGA reference clock.

Returns:

dict: Updated configuration dictionary.

property vco_max: int

Get the VCO max frequency in Hz for QPLL.

property vco_min: int

Get the VCO min frequency in Hz for QPLL.

class adijif.fpgas.xilinx.ultrascaleplus.QPLL1(parent_transceiver: CpoModel)

Bases: QPLL

QPLL1 model for Ultrascale+ transceivers.

property vco_max: int

VCO max frequency in Hz for QPLL1.

property vco_min: int

VCO min frequency in Hz for QPLL1.

class adijif.fpgas.xilinx.ultrascaleplus.UltraScalePlus(parent=None, speed_grade: str | None = '-2', transceiver_type: str | None = 'GTXE2', *args, **kwargs)

Bases: XilinxPLL, core, gekko_translation

Ultrascale+ PLLs transceiver models.

add_constraints(config: dict, fpga_ref: int | float, converter: converter) dict

Add constraints for PLLs.

Args:

config (dict): Configuration dictionary. fpga_ref (int, float): FPGA reference clock. converter (conv): Converter object.

Returns:

dict: Updated configuration dictionary.

add_plls() None

Add PLLs to the model.

get_config(config: dict, converter: converter, fpga_ref: int | float) dict

Get the configuration of the PLLs.

Args:

config (dict): Configuration dictionary. converter (conv): Converter object. fpga_ref (int, float): FPGA reference clock.

Returns:

dict: Updated configuration dictionary.