Example: Assign the Variable rloc to the String Value of a Block RAM Cell RLOC - Example: Assign the Variable rloc to the String Value of a Block RAM Cell RLOC - 2026.1 English - UG903

Vivado Design Suite User Guide: Using Constraints (UG903)

Document ID
UG903
Release Date
2026-07-01
Version
2026.1 English
% set rloc [getAbsRLOC $ram0] 
X33Y0

You can use the Tcl dict command to build a dictionary (associative array) of cells and absolute grid RLOCs for the update_macro command. A Tcl associative array is a series of key-value pairs. The keys are the macro cell objects, and the values are the cell RLOCs. This approach automates macro creation when working with many cells.

The following example uses the absolute grid, but you can also apply the same method to the normal grid.

Assume $cells is the list of macro cells, and each cell in $cells has already been placed to form the desired macro pattern. The following Tcl proc creates a list of cell-RLOC pairs for the update_macro command:

proc buildRLOCList {cells} {
  set rlocs [dict create] # initialize dictionary   called rlocs
  foreach cell $cells {
  # dictionary key is cell, value is absolute   RLOC
    dict set rlocs $cell [getAbsRLOC $cell]
  }
  return $rlocs
}