Skip to content
Open
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
01e6e3a
[vpr][constraint] update constrain file to include relative placement…
amin1377 Jul 16, 2026
277d561
[vpr][base] add UserRelativeGroup to store rel macro info
amin1377 Jul 16, 2026
d07fdc3
[vpr][base] add UserRelativeMacros to VprConstraints
amin1377 Jul 16, 2026
1eb1322
[vpr][base] add relative_macros to FloorplanningContext
amin1377 Jul 16, 2026
c7f4117
[vpr][base] add functions related to rel placement
amin1377 Jul 16, 2026
d879710
[vpr][base] rel place: update autogenerated files
amin1377 Jul 16, 2026
fc1a0cf
[vpr][pack] add check_cluster_relative_group and rel_group to cluster…
amin1377 Jul 17, 2026
ad0d21a
[vpr][pack] add relative macro attraction group functions
amin1377 Jul 17, 2026
d8bd6b1
[vpr][pack] add rel mol attraction group in candidate sel
amin1377 Jul 17, 2026
f3d36c1
[vpr][pack] add check_clustering_relative_group_consistency
amin1377 Jul 21, 2026
d165bce
[vpr][pack] add BLK_FAILED_RELATIVE_GROUP to errors
amin1377 Jul 21, 2026
fa9dfe0
[vpr][pack] increase gain for rpm so they get packed firt
amin1377 Jul 21, 2026
2c55729
[vpr][pack] update try pack to check for rpm
amin1377 Jul 21, 2026
d5c82d6
[vpr][pack] pass group gain and pull_in_initial_search when rebuildin…
amin1377 Jul 21, 2026
9b2eba4
[vpr][place] add append_user_defined_macros_
amin1377 Jul 21, 2026
3ed8f00
[vpr][place] fix root location issue with rmp
amin1377 Jul 21, 2026
05d77c6
[doc][vpr] add rmp doc
amin1377 Jul 22, 2026
887a988
[vpr][test] add unit test for UserRelativeMacro
amin1377 Jul 22, 2026
8539cd4
[ci][strong] add rmp test
amin1377 Jul 22, 2026
d728376
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Jul 22, 2026
86ddaaf
make format
amin1377 Jul 22, 2026
d230e69
[vpr][pack] recreate attraction group for rel group if packing doesn'…
amin1377 Jul 23, 2026
0f16846
[vpr][pack] remove duplicate attraction groups
amin1377 Jul 23, 2026
e9e5c9c
[vpr][pack] check macro conflict with rel placement
amin1377 Jul 23, 2026
6c4e68c
[vpr][base] add fast path for get_atom_group
amin1377 Jul 23, 2026
91a1bae
[vpr][base] improve rmp log msg
amin1377 Jul 23, 2026
df8a9c2
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Jul 27, 2026
85ca126
[vpr][pack] shorten comments
amin1377 Jul 27, 2026
ba13e4b
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Jul 29, 2026
c2f60ec
[vpr][pack] consider rpm in prepack
amin1377 Jul 29, 2026
cdbc4c9
[vpr][place] remove redundant checks
amin1377 Jul 29, 2026
1c47e03
[vpr] fix comments for rpm
amin1377 Jul 29, 2026
2c85ae8
[vpr][place] add macro log to MoveAbortionLogger
amin1377 Jul 30, 2026
8c18649
[vpr][cli] pack_relative_group_best_effort
amin1377 Aug 3, 2026
93abede
[vpr][cli] remove pack_relative_group_best_effort
amin1377 Aug 3, 2026
c68d2c0
[vpr][place] break the loop when swapping macros
amin1377 Aug 3, 2026
11474b5
[doc] remove best effort mode doc related to rpm
amin1377 Aug 3, 2026
a8d437d
[vpr][pack] add rmp methods into attraction group
amin1377 Aug 3, 2026
805d1d5
[vpr][place] record whether user macro exist + check it doesn't overl…
amin1377 Aug 3, 2026
15b15f0
[vpr][pack] add pack_relative_group_into_cluster to pack a group into…
amin1377 Aug 4, 2026
fefae71
[vpr][place] add root location check to macro_can_be_placed
amin1377 Aug 5, 2026
1cd2f3b
[vpr][pack] remove redundant functions after simplifying pack retry
amin1377 Aug 5, 2026
0acb1fe
[vpr][pack] retry failed rel mol for limited number of times
amin1377 Aug 5, 2026
0a9d0b9
[vpr][pack] add helper functions to set/get whether cluster is reserv…
amin1377 Aug 5, 2026
e5b335d
[vpr][pack] reserve cluster for rel mol during repack
amin1377 Aug 5, 2026
99dbccf
[vpr][pack] fail fast if number of split macros for rel mols increase
amin1377 Aug 5, 2026
bbe1f40
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Aug 5, 2026
7e9eb13
update submodules
amin1377 Aug 5, 2026
e09df0a
[vpr][ap] error out if RPM is used
amin1377 Aug 5, 2026
111e7a8
[ci] update rpm test
amin1377 Aug 5, 2026
b5e65cf
[vpr][place] narrow the cycle filter
amin1377 Aug 5, 2026
a7b68c0
[vpr][pack] check for chain in validate_relative_group_molecules
amin1377 Aug 6, 2026
a76a50a
[ci] add carry chain to constraint file
amin1377 Aug 9, 2026
0541036
[ci] update rpm blif file
amin1377 Aug 9, 2026
8cb614c
[doc] update rpm doc
amin1377 Aug 9, 2026
588f088
check for long chain cluster to not belong to multiple rmp groups
amin1377 Aug 10, 2026
abaae85
[doc][rpm] update doc to reflect changes in macro
amin1377 Aug 10, 2026
c3b4ade
[vpr][pack] add check_cluster_long_chain_ownership to check for long …
amin1377 Aug 10, 2026
a15902e
[vpr][place] merge arch macro and user macro for chains
amin1377 Aug 10, 2026
77fe78b
[ci] update rmp blif to have a chain spanning mulitple clusters
amin1377 Aug 10, 2026
a13b57f
[ci][rmp] update golden resutls
amin1377 Aug 10, 2026
0aa9be1
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Aug 10, 2026
addc223
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Aug 11, 2026
adace89
[vpr][pack] add assertion to check for pin class size
amin1377 Aug 18, 2026
10085e9
[vpr][pack] remove bypass paramter
amin1377 Aug 18, 2026
9de704d
[vpr][pack] remove bypass parameter
amin1377 Aug 18, 2026
ec0c71b
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Aug 18, 2026
188d87c
[vpr][pack] choose group atoms first
amin1377 Aug 18, 2026
e0210a5
[vpr][pack] remove rel group from attraction groups
amin1377 Aug 19, 2026
3851b99
[vpr][pack] pack rpm clusters first
amin1377 Aug 19, 2026
424f6c7
[vpr][pack] remove rpm reservations from cluster legalizer
amin1377 Aug 19, 2026
462ec85
[vpr][pack] remove attraction group provisions for rpm in pack.cpp
amin1377 Aug 19, 2026
2b3d0f5
[vpr][pack] add get_molecule_relative_group
amin1377 Aug 19, 2026
3e4f37c
[vpr][place] fix rpm comments
amin1377 Aug 19, 2026
01f7cd2
[vpr][pack] remove remaining code related to prev version of rpm
amin1377 Aug 19, 2026
9d667b0
[ci] update rpm golden results
amin1377 Aug 19, 2026
f4bb71d
[doc][vpr][rpm] add site_path
amin1377 Aug 21, 2026
32f786a
[doc][vpr] add doc related to site_path
amin1377 Aug 21, 2026
862ad89
[vpr][constraint] add site_path
amin1377 Aug 24, 2026
633ba3e
[vpr][base] print site_path when writing flat place file
amin1377 Aug 24, 2026
14bf26b
[vpr][base] add atom sith path to rpm ds
amin1377 Aug 24, 2026
7e9082e
[vpr][pack] use forced_placement in cluster_placement
amin1377 Aug 24, 2026
9880676
[vpr][pack] record why atom in rpm cannot be placed
amin1377 Aug 24, 2026
c2f6244
[vpr][pack] pack rpm forced sites first in greedy clusterer
amin1377 Aug 24, 2026
c5f4f46
[doc] update RPM doc
amin1377 Aug 24, 2026
58e121a
[vpr][base] update constrain serializer with site_path
amin1377 Aug 24, 2026
c54be42
[vpr][pack] check for molecule root rpm constraint
amin1377 Aug 24, 2026
e0bc8d5
[vpr][pack] verify site_path is honored
amin1377 Aug 24, 2026
189a507
[vpr][test] add unit test for rpm
amin1377 Aug 24, 2026
d4ab376
[ci] update rpm test
amin1377 Aug 24, 2026
8b29a8f
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Aug 24, 2026
ddf2fb6
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Aug 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions doc/src/vpr/relative_placement_constraints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

Relative Placement Constraints
==============================
.. _relative_placement_constraints:

VPR supports *relative placement macros*: constraints that fix the placement of groups of primitives **relative to each other**, without pinning them to absolute locations on the chip.
Each macro consists of one *reference group* and one or more *relative groups* of primitives (a.k.a. atoms).
The constraints affect both packing and placement:

* **Packing:** the atoms of each group are packed together into a single cluster, and atoms of different groups (of any macro) are never packed into the same cluster. Unconstrained atoms may share a cluster with a group.
* **Placement:** the clusters created from the groups of one macro form a placement macro (like an architectural carry chain): each relative group's cluster is placed at exactly its ``(x_offset, y_offset, sub_tile_offset)`` from the reference group's cluster, and the whole macro moves as a rigid unit during initial placement and simulated annealing. The placer chooses *where* the macro goes; the constraints fix only the internal geometry.

Relative placement constraints are specified inside the same XML constraints file as :ref:`placement (region) constraints <placement_constraints>` and are read with :option:`vpr --read_vpr_constraints`.
They compose with region constraints: an atom may belong to both a partition and a relative group, in which case the macro is placed such that the region constraints of all its members are satisfied.

A Relative Placement Constraints File Example
---------------------------------------------

.. code-block:: xml
:caption: An example of relative placement macros in a VPR constraints file.
:linenos:

<vpr_constraints tool_name="vpr">
<relative_macro_list>
<relative_macro name="dsp_with_ctrl_logic">
<reference_group>
<add_atom name_pattern="mult_36.out_reg"/> <!-- The anchor of the macro -->
</reference_group>
<relative_group x_offset="1" y_offset="0" sub_tile_offset="0">
<add_atom name_pattern="^ctrl_lut_[0-4]$" is_regex="true"/> <!-- These LUTs are packed into one cluster, placed directly right of the anchor -->
</relative_group>
</relative_macro>
<relative_macro name="bit_sliced_datapath">
<reference_group>
<add_atom name_pattern="slice0_.*" is_regex="true"/>
</reference_group>
<relative_group x_offset="0" y_offset="1" sub_tile_offset="0">
<add_atom name_pattern="slice1_.*" is_regex="true"/>
</relative_group>
<relative_group x_offset="0" y_offset="2" sub_tile_offset="0">
<add_atom name_pattern="slice2_.*" is_regex="true"/>
</relative_group>
</relative_macro>
</relative_macro_list>
</vpr_constraints>

.. _end:

Relative Placement Constraints File Format
------------------------------------------

The ``<vpr_constraints>`` top-level tag may contain one ``<relative_macro_list>`` tag, which contains an unbounded number of ``<relative_macro>`` tags.

.. arch:tag:: <relative_macro name="string">

A relative macro is made up of exactly one ``<reference_group>`` (which must come first) followed by one or more ``<relative_group>`` tags.

:req_param name:
A unique name for the macro, used in log and error messages.

.. arch:tag:: <reference_group>

The anchor of the macro. The atoms added to this group are packed into one cluster, and all relative groups' offsets are measured from this cluster's location. Contains one or more ``<add_atom>`` tags (same syntax and matching semantics as in a ``<partition>``, see :ref:`placement_constraints`; the ``logical_block_location`` attribute is not supported here and is ignored with a warning).

.. arch:tag:: <relative_group x_offset="int" y_offset="int" sub_tile_offset="int" layer_offset="int">

A group of atoms packed into one cluster, placed at the given offset from the reference group's cluster. Contains one or more ``<add_atom>`` tags.

:req_param x_offset:
Grid-tile x offset of this group's cluster from the reference cluster. May be negative.

:req_param y_offset:
Grid-tile y offset of this group's cluster from the reference cluster. May be negative.

:req_param sub_tile_offset:
Sub-tile offset of this group's cluster from the reference cluster. Use ``0`` when the tiles have a single sub-tile. This attribute is currently required; a future extension will allow omitting it to mean "any compatible sub-tile".

:opt_param layer_offset:
Layer (die) offset. Must currently be ``0`` (cross-layer relative macros are not supported and are rejected when the file is loaded).
**Default:** ``0``

Semantics and Restrictions
--------------------------

* **One group, one cluster.** All atoms of a group must fit into a single cluster; this is enforced. If a group cannot be packed into one cluster (e.g. it is larger than the cluster type allows, or conflicts with architectural pack patterns), packing fails with an error naming the group. Prepacked molecules (e.g. a LUT and the FF it drives, or carry-chain segments) that mix a constrained atom with unconstrained atoms are pulled into the group's cluster as a whole. A molecule whose atoms belong to two *different* groups is reported as an error: a molecule is indivisible (all its atoms always pack into one cluster), so it can never satisfy constraints that require its atoms to be in different clusters.
* **Groups never share a cluster.** This holds between groups of the same macro and between groups of different macros. Unconstrained atoms may fill the remaining capacity of any group's cluster.
* **Offsets must match the device grid.** The placer never adjusts an offset: it only uses positions where every member of the macro lands on a tile that can host its cluster. For example, ``x_offset="1"`` between a RAM cluster and a CLB cluster only works if the device has a CLB column immediately to the right of a RAM column — and if the RAM tile spans four grid rows, the RAM must sit on a RAM tile's first row, so the macro can only move vertically in steps of four. If no position on the device satisfies all members, placement fails after an exhaustive search.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would replace the dash at "[...] a RAM column — and if the RAM tile spans [...]" with a period. The vertical spacing scenario is a whole different sentence really.

if the RAM tile spans four grid rows, the RAM must sit on a RAM tile's first row, so the macro can only move vertically in steps of four.

I think I understand what this is saying (the "position" of a block larger than 1x1 is it's bottom left corner so if you're working with these kind of blocks the offsets must point to the bottom left corner of each block) but the current wording is hard to understand.

* **Members may have different block types** (e.g. a CLB next to a DSP).
* **Interaction with carry chains:** a cluster cannot belong to both a relative macro and an architecture-derived placement macro (carry chain); this is reported as an error.
* Relative macro constraints are validated when a packed netlist (``.net``) or placement (``.place``) file is loaded, so stale files that do not satisfy the constraints are rejected.
10 changes: 7 additions & 3 deletions doc/src/vpr/vpr_constraints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,33 @@ VPR Constraints
=========================
.. _vpr_constraints:

Users can specify placement and/or global routing constraints on all or part of a design through a constraints file in XML format, as shown in the format below. These constraints are optional and allow detailed control of the region on the chip in which parts of the design are placed, and of the routing of global nets through dedicated (usually clock) networks.
Users can specify placement and/or global routing constraints on all or part of a design through a constraints file in XML format, as shown in the format below. These constraints are optional and allow detailed control of the region on the chip in which parts of the design are placed, of the placement of parts of the design relative to each other, and of the routing of global nets through dedicated (usually clock) networks.

.. code-block:: xml
:caption: The overall format of a VPR constraints file
:linenos:

<vpr_constraints tool_name="vpr">
<partition_list>
<!-- Placement constraints are specified inside this tag -->
<!-- Placement (region) constraints are specified inside this tag -->
</partition_list>
<relative_macro_list>
<!-- Relative placement constraints are specified inside this tag -->
</relative_macro_list>
<global_route_constraints>
<!-- Global routing constraints are specified inside this tag -->
</global_route_constraints>
</vpr_constraints>

.. note:: Use the VPR option :option:`vpr --read_vpr_constraints` to specify the VPR constraints file that is to be loaded.

The top-level tag is the ``<vpr_constraints>`` tag. This tag can contain ``<partition_list>`` and ``<global_route_constraints>`` tags. The ``<partition_list>`` tag contains information related to placement constraints, while ``<global_route_constraints>`` contains information about global routing constraints. The details for each of these constraints are given in the respective sections :ref:`Placement Constraints <placement_constraints>` and :ref:`Global Route Constraints <global_routing_constraints>`.
The top-level tag is the ``<vpr_constraints>`` tag. This tag can contain ``<partition_list>``, ``<relative_macro_list>``, and ``<global_route_constraints>`` tags. The ``<partition_list>`` tag contains information related to placement (region) constraints, the ``<relative_macro_list>`` tag contains relative placement constraints, while ``<global_route_constraints>`` contains information about global routing constraints. The details for each of these constraints are given in the respective sections :ref:`Placement Constraints <placement_constraints>`, :ref:`Relative Placement Constraints <relative_placement_constraints>`, and :ref:`Global Route Constraints <global_routing_constraints>`.

.. toctree::
:maxdepth: 2

placement_constraints
relative_placement_constraints
global_routing_constraints


13 changes: 12 additions & 1 deletion vpr/src/analytical_place/analytical_placement_flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,19 @@ void run_analytical_placement_flow(t_vpr_setup& vpr_setup) {
const UserPlaceConstraints& constraints = g_vpr_ctx.floorplanning().constraints;
const t_ap_opts& ap_opts = vpr_setup.APOpts;

// User-defined relative placement macros are only honored by the traditional
// pack/place flow; the AP flow would silently ignore them after prepacking.
if (g_vpr_ctx.floorplanning().relative_macros.get_num_macros() > 0) {
VPR_FATAL_ERROR(VPR_ERROR_AP,
"User-defined relative placement macros are not supported in the "
"analytical placement flow. Use the traditional flow (--pack --place) instead.");
}

// Run the prepacker
const Prepacker prepacker(atom_nlist, device_ctx.arch->models, device_ctx.logical_block_types);
const Prepacker prepacker(atom_nlist,
device_ctx.arch->models,
device_ctx.logical_block_types,
g_vpr_ctx.floorplanning().relative_macros);

// Pre-compute the pre-clustering timing delays. This object will be passed
// into the global placer and the full legalizer to make them timing driven.
Expand Down
Loading
Loading