Skip to content

Commit a6538ac

Browse files
authored
Merge pull request #2012 from verilog-to-routing/add_place_constraints_documentation
Document VPR placement constraints
2 parents e887717 + 34346be commit a6538ac

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

doc/src/vpr/placement_constraints.rst

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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. 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:
33+
34+
Constraints File Format
35+
-----------------------
36+
37+
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
38+
39+
#. Which primitives are to have placement constraints
40+
#. The regions on the FPGA chip to which those primitives must be constrained
41+
42+
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.
43+
44+
.. note:: Use the VPR :option: `--read_vpr_constraints` to specify the VPR placement constraints file that is to be loaded.
45+
46+
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.
47+
48+
Partitions, Atoms, and Regions
49+
------------------------------
50+
51+
Partition
52+
^^^^^^^^^
53+
54+
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.
55+
56+
:req_param name:
57+
A name for the partition.
58+
59+
:req_param add_atom:
60+
A tag used for adding an atom primitive to the partition.
61+
62+
:req_param add_region:
63+
A tag used for specifying a region for the partition.
64+
65+
Atom
66+
^^^^
67+
68+
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:
69+
70+
:req_param name_pattern:
71+
The name of the atom.
72+
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.
74+
75+
Region
76+
^^^^^^
77+
78+
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.
79+
80+
:req_param x_low:
81+
The x value of the lower left point of the rectangle.
82+
83+
:req_param y_low:
84+
The y value of the lower left point of the rectangle.
85+
86+
:req_param x_high:
87+
The x value of the upper right point of the rectangle.
88+
89+
:req_param y_high:
90+
The y value of the upper right point of the rectangle.
91+
92+
:opt_param subtile:
93+
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.
94+
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.
96+
97+
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.
98+
99+
100+
101+
102+
103+
104+
105+

0 commit comments

Comments
 (0)