Convert RPMs to XDC macros wherever feasible because XDC macros are the preferred method for implementing relative placement constraints. You can perform the conversion manually by removing RPM attributes from the HDL sources and creating equivalent XDC macros. You can also automate the process by using Tcl to replace RPM attributes with XDC macro constraints.
Automated Conversion Process
Follow these steps to automate the conversion:
- In all HDL sources, replace each RPM attribute with a similarly named string.
For example:
- Replace
hu_setwithm_hu_set - Replace
u_setwithm_u_set - Replace
rlocwithm_rloc
This prevents the RPMs from being processed, while still passing the inactive attributes to the synthesized netlist as cell properties.
- Replace
- Open the synthesized design or run
link_design, and create XDC macros based on the inactive properties. For example, each HU_SET produces a cell property calledm_hu_setthat you can use to create the equivalent XDC macro. Each cell within the original HU_SET has a propertym_rlocthat you can convert into an RLOC. - Save the constraints, which now include the XDC macro definitions.
The best way to handle large-scale conversions is to use Tcl to build XDC macro cell
lists based on their unique m_hu_set or m_uset
values.
VHCL Conversion Example
The original VHDL source includes a HU_SET RPM called set0 with two cells, one with RLOC X0Y0 and the other with RLOC X0Y1.
signal r0 : std_logic;
signal r1 : std_logic;
attribute hu_set : string;
attribute rloc : string;
attribute hu_set of r0 : signal is "set0";
attribute hu_set of r1 : signal is "set0";
attribute rloc of r0 : signal is "X0Y0";
attribute rloc of r1 : signal is "X0Y1";
Next the VHDL source is modified to replace hu_set and RLOC with similarly named but inactive attributes:
signal r0 : std_logic;
signal r1 : std_logic;
attribute m_hu_set : string;
attribute m_rloc : string;
attribute m_hu_set of r0 : signal is "set0";
attribute m_hu_set of r1 : signal is "set0";
attribute m_rloc of r0 : signal is "X0Y0";
attribute m_rloc of r1 : signal is "X0Y1";
After synthesis, filter the cells by properties:
Vivado% get_cells -filter {m_hu_set == "set0"}
r0_reg r1_reg
Vivado% get_property m_rloc [get_cells {r0_reg r1_reg}]
X0Y0 X0Y1
This provides the necessary information to create an XDC macro to replace the RPM:
Vivado% create_macro set0
Vivado% update_macro set0 {r0_reg X0Y0 r1_reg X0Y1}
Save these XDC constraints as part of the design constraints.
Tcl Script Example for HU_SET Coversion
# create a sorted list of all unique RPMs according to m_hu_set values
set RPMs [lsort -uniq [get_property m_hu_set [get_cells -hier -filter
{primitive_level != INTERNAL}]]]
# remove the first element which is empty (no m_hu_set property)
set RPMs [lrange $RPMs 1 end]
# iterate over list of RPMs, convert each to an XDC macro
# get each RPM cell of the RPM with its RLOC
# build a list for the update_macro command
foreach rpm $RPMs {
create_macro $rpm
set cells [get_cells -hier -filter "m_hu_set == $rpm"]
set rlocs [list]
foreach cell $cells { lappend rlocs $cell
lappend rlocs [get_property m_rloc $cell]
}
update_macro $rpm $rlocs
puts "created XDC macro $rpm, cell list: rlocs"
}
This script finds all HU_SET-based RPMs, gathers their
properties, and creates equivalent XDC macros automatically.