gen_npnr_model

Nextpnr model generation for FABulous FPGA fabrics.

This module provides functionality to generate nextpnr models from FABulous fabric definitions. The nextpnr model includes detailed descriptions of programmable interconnect points (PIPs), basic elements of logic (BELs), and routing resources needed for place-and-route operations.

The generated models enable nextpnr to understand the fabric architecture and perform placement and routing for user designs.

Attributes

Functions

belLines(bel, letter, x, y)

Build a BEL's legacy v1 line, its v2/v3 blocks, and any pin constraint.

genNextpnrModel(fabric[, delay_model])

Generate the fabric's nextpnr model.

writeNextpnrPipFile(fabric, outputFile[, delay_model])

Write the nextpnr pip file for the given fabric.

Module Contents

BASE_DELAY_DEFAULT = 3.0[source]
CARRY_CICO_DELAY = 0.2[source]
CARRY_I_DELAY = 1.0[source]
CARRY_PREDICT_DELAY = 0.5[source]
DELAY_EPSILON = 0.25[source]
DUMMY_PIP_DELAY = 8[source]
FF_CLK_TO_Q = 1.0[source]
FF_HOLD = 0.1[source]
FF_SETUP = 2.5[source]
IO_BEL_TYPES = ('IO_1_bidirectional_frame_config_pass', 'InPass4_frame_config', 'OutPass4_frame_config',...[source]
IO_CLK_TO_OUT = 2.5[source]
IO_HOLD = 0.1[source]
IO_SETUP = 2.5[source]
LC_ESTIMATE_LINES: list[str][source]
LUT_DELAY = 3.0[source]
PLACEMENT_ESTIMATE_TEXT: str = Multiline-String[source]
Show Value
"""
"""
RIPUP_PENALTY = 0.5[source]
belLines(bel, letter, x, y) tuple[str, list[str], list[str], list[str]][source]

Build a BEL’s legacy v1 line, its v2/v3 blocks, and any pin constraint.

The bel.v3 block additionally carries timing-arc lines, but only for the BEL types nextpnr currently times (FABULOUS_LC, InPass4_frame_config, OutPass4_frame_config and their _mux variants); every other type gets no arcs so no new timing paths are introduced.

Parameters:
  • bel (Bel) – The BEL to describe.

  • letter (str) – The BEL’s Z-position letter within its tile.

  • x (int) – Tile X coordinate the BEL belongs to.

  • y (int) – Tile Y coordinate the BEL belongs to.

Returns:

(v1_line, v2_lines, v3_lines, constrain_lines) - the legacy bel.txt line, the bel.v2/bel.v3 block lines, and zero or one set_io line.

genNextpnrModel(fabric, delay_model=None) tuple[str, str, str, str, str][source]

Generate the fabric’s nextpnr model.

Parameters:
  • fabric (Fabric) – Fabric object containing tile information.

  • delay_model (FABulousTimingModelInterface, optional) – Timing model interface to provide delay information, by default None.

Returns:

  • pipStr: A string with tile-internal and tile-external pip descriptions.

  • belStr: A string with old style BEL definitions.

  • belv2Str: A string with new style BEL definitions.

  • belv3Str: A string with new style BEL definitions including timing.

  • constrainStr: A string with constraint definitions.

Raises:

InvalidState – If a wire in a tile points to an invalid tile outside the fabric bounds.

writeNextpnrPipFile(fabric, outputFile, delay_model=None) None[source]

Write the nextpnr pip file for the given fabric.

Parameters:
  • fabric (Fabric) – Fabric object containing tile information.

  • outputFile (Path) – File to write the pip information to.

  • delay_model (FABulousTimingModelInterface, optional) – Timing model interface to provide delay information, by default None.