Skip to content

Commit 34346be

Browse files
committed
Added more context to top comment and constraints file example
1 parent d13483e commit 34346be

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

doc/src/vpr/placement_constraints.rst

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
11
VPR Placement Constraints
22
=========================
33

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.
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. For example, a user may use placement constraints to lock down pins to specific locations on the chip. Also, groups of primitives may be locked down to regions on the chip in CAD flows that use floorplanning or modular design, or to hand-place a timing critical piece.
5+
6+
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.
7+
8+
A Constraints File Example
9+
--------------------------
10+
11+
.. code-block:: xml
12+
:caption: An example of a placement constraints file in XML format.
13+
:linenos:
14+
15+
<vpr_constraints tool_name="vpr">
16+
<partition_list>
17+
<partition name="Part0">
18+
<add_atom name_pattern="li354">
19+
<add_atom name_pattern="alu*"> <!-- Regular expressions can be used to provide name patterns of the primitives to be added -->
20+
<add_atom name_pattern="n877">
21+
<add_region x_low="3" y_low="1" x_high="7" y_high="2"> <!-- Two rectangular regions are specified, together describing an L-shaped region -->
22+
<add_region x_low="7" y_low="3" x_high="7" y_high="6"
23+
</partition>
24+
<partition name="Part1">
25+
<add_region x_low="3" y_low="3" x_high="7" y_high="7" subtile="0"> <!-- One specific location is specified -->
26+
<add_atom name_pattern="n4917">
27+
<add_atom name_pattern="n6010">
28+
</partition>
29+
</partition_list>
30+
</vpr_constraints>
31+
32+
.. _end:
533

634
Constraints File Format
735
-----------------------
@@ -42,7 +70,7 @@ An ``<add_atom>`` tag is used to add an atom that must be constrained to the par
4270
:req_param name_pattern:
4371
The name of the atom.
4472

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.
73+
The ``name_pattern`` can be the exact name of the atom from the input atom netlist that was passed to 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. For example, if a module contains primitives named in the pattern of "alu[0]", "alu[1]", and "alu[2]", the regular expression "alu*" would add all of the primitives from that module.
4674

4775
Region
4876
^^^^^^
@@ -64,37 +92,11 @@ An ``<add_region>`` tag is used to add a region to the partition. A ``region`` i
6492
:opt_param subtile:
6593
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.
6694

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.
95+
The optional ``subtile`` attribute is commonly used when constraining an atom to a specific location on the chip (e.g. an exact I/O location). It is legal to use with larger regions, but uncommon.
6896

6997
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.
7098

7199

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-
98100

99101

100102

0 commit comments

Comments
 (0)