<commit_before># Constraints

There are three types of constraints available for end users of nextpnr.

## Architecture-specific IO Constraints

Architectures may provide support for their native (or any other) IO constraint format.
The iCE40 architecture supports PCF constraints thus:

    set_io led[0] 3

and the ECP5 architecture supports a subset of LPF constraints:

    LOCATE COMP "led[0]" SITE "E16";
    IOBUF PORT "led[0]" IO_TYPE=LVCMOS25;


## Absolute Placement Constraints

nextpnr provides generic support for placement constraints by setting the Bel attribute on the cell to the name of
the Bel you wish it to be placed at. For example:
<commit_msg>update doc - UNTESTED on real hardware<commit_after># Constraints

There are three types of constraints available for end users of nextpnr.

## Architecture-specific IO Constraints

Architectures may provide support for their native (or any other) IO constraint format.
The iCE40 architecture supports PCF constraints thus:

    set_io led[0] 3

and the ECP5 architecture supports a subset of LPF constraints (for details see Lattice Technical Note "FPGA-TN-02032 1.3"):

    LOCATE COMP "led[0]" SITE "E16";
    IOBUF PORT "led[0]" IO_TYPE=LVCMOS25;
    IOBUF ...  DRIVE=8;
    IOBUF ... OPENDRAIN=ON|OFF;
    IOBUF ... TERMINATION=50;
    IOBUF ... DIFFRESISTOR=100; //for differential IO only
    IOBUF ... CLAMP=ON|OFF;
    IOBUF ... PULLMODE=UP|DOWN|NONE;
    IOBUF ... SLEWRATE=FAST|SLOW; //outputs only
    IOBUF ... HYSTERESIS=ON|OFF;

## Absolute Placement Constraints

nextpnr provides generic support for placement constraints by setting the Bel attribute on the cell to the name of
the Bel you wish it to be placed at. For example:

{'fraction_non_alphanumeric': 0.07130333138515488, 'fraction_numerical': 0.020455873758036237, 'mean_word_length': 3.9337175792507204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7277249', 'n_tokens_mistral': 531, 'n_tokens_neox': 492, 'n_words': 219}