Skip to content

Commit d13483e

Browse files
committed
Added a new file for documenting VPR placement constraints
1 parent 829c06d commit d13483e

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

doc/src/vpr/placement_constraints.rst

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
VPR Placement Constraints
2+
=========================
3+
4+
VPR supports running flows with placement constraints. Placement constraints are set on primitives to lock them down to specified regions on the FPGA chip. The placement constraints should be specified by the user using an XML constraints file format, as described in the section below. When VPR is run with placement constraints, both the packing and placement flows are performed in such a way that the constraints are respected. The packing stage does not pack any primitives together that have conflicting floorplan constraints. The placement stage considers the floorplan constraints when choosing a location for each clustered block during initial placement, and does not move any block outside of its constraint boundaries during place moves.
5+
6+
Constraints File Format
7+
-----------------------
8+
9+
VPR has a specific XML format which must be used when creating a placement constraints file. The purpose of this constraints file is to specify
10+
11+
#. Which primitives are to have placement constraints
12+
#. The regions on the FPGA chip to which those primitives must be constrained
13+
14+
The file is passed as an input to VPR when running with placement constraints. When the file is read in, its information is used during the packing and placement stages of VPR. The hierarchy of the file is set up as follows.
15+
16+
.. note:: Use the VPR :option: `--read_vpr_constraints` to specify the VPR placement constraints file that is to be loaded.
17+
18+
The top level tag is the ``<vpr_constraints>`` tag. This tag contains one ``<partition_list>`` tag. The ``<partition_list>`` tag can be made up of an unbounded number of ``<partition>`` tags. The ``<partition>`` tags contains all of the detailed information of the placement constraints, and is described in detail below.
19+
20+
Partitions, Atoms, and Regions
21+
------------------------------
22+
23+
Partition
24+
^^^^^^^^^
25+
26+
A partition is made up of two components - a group of primitives (a.k.a. atoms) that must be constrained to the same area on the chip, and a set of one or more regions specifying where those primitives must be constrained. The information for each partition is contained within a ``<partition>`` tag, and the number of ``partition`` tags that the partition_list tag can contain is unbounded.
27+
28+
:req_param name:
29+
A name for the partition.
30+
31+
:req_param add_atom:
32+
A tag used for adding an atom primitive to the partition.
33+
34+
:req_param add_region:
35+
A tag used for specifying a region for the partition.
36+
37+
Atom
38+
^^^^
39+
40+
An ``<add_atom>`` tag is used to add an atom that must be constrained to the partition. Each partition can contain any number of atoms from the circuit. The ``<add_atom>`` tag has the following attribute:
41+
42+
:req_param name_pattern:
43+
The name of the atom.
44+
45+
The ``name_pattern`` can either be the exact name of the atom from the atom netlist produced by VPR. It can also be a regular expression, in which case VPR will add all atoms from the netlist which have a portion of their name matching the regular expression to the partition.
46+
47+
Region
48+
^^^^^^
49+
50+
An ``<add_region>`` tag is used to add a region to the partition. A ``region`` is a rectangular area on the chip. A partition can contain any number of independent regions - the regions within one partition must not overlap with each other (in order to ease processing when loading in the file). An ``<add_region>`` tag has the following attributes.
51+
52+
:req_param x_low:
53+
The x value of the lower left point of the rectangle.
54+
55+
:req_param y_low:
56+
The y value of the lower left point of the rectangle.
57+
58+
:req_param x_high:
59+
The x value of the upper right point of the rectangle.
60+
61+
:req_param y_high:
62+
The y value of the upper right point of the rectangle.
63+
64+
:opt_param subtile:
65+
Each x, y location on the grid may contain multiple locations known as subtiles. This paramter is an optional value specifying the subtile location that the atom(s) of the partition shall be constrained to.
66+
67+
The optional ``subtile`` attribute is useful when the user would like to constrain a primitive to one specific x, y, subtile location on the chip. In this case, ``x_low`` can be set to equal ``x_high``, ``y_low`` can equal ``y_high``, and the subtile attribute can be specified.
68+
69+
If a user would like to specify an area on the chip with an unusual shape (e.g. L-shaped or T-shaped), they can simply add multiple ``<add_region>`` tags to cover the area specified.
70+
71+
72+
A Constraints File Example
73+
--------------------------
74+
75+
.. code-block:: xml
76+
:caption: An example of a placement constraints file in XML format.
77+
:linenos:
78+
79+
<vpr_constraints tool_name="vpr">
80+
<partition_list>
81+
<partition name="Part0">
82+
<add_atom name_pattern="li354">
83+
<add_atom name_pattern="lo326">
84+
<add_atom name_pattern="n877">
85+
<add_region x_low="2" y_low="3" x_high="10" y_high="12">
86+
<add_region x_low="14" y_low="16" x_high="25" y_high="25">
87+
</partition>
88+
<partition name="Part1">
89+
<add_region x_low="3" y_low="3" x_high="7" y_high="7" subtile="0">
90+
<add_atom name_pattern="n4917">
91+
<add_atom name_pattern="n6010">
92+
</partition>
93+
</partition_list>
94+
</vpr_constraints>
95+
96+
.. _end:
97+
98+
99+
100+
101+
102+
103+

0 commit comments

Comments
 (0)