For this flow to work smoothly, write XDC constraints so their effects remain local to the IP or sub-module instance. Vivado can scope queries to a specific hierarchy level, as shown previously in Constraints Scoping. When developing constraints for an IP or sub-level module, understand how the query commands behave.
- Limit cell/net/pin queries to the scoped instance and its sub-levels using
the following
command:
get_cells <name pattern> get_nets <name pattern> get_pins <name pattern>- The
NAMEproperty shows the full path from the top level, rather than relative to the scoped instance. - Use the
-filteroption with a glob match that starts with*for name patterns as shown in the following example:get_nets -hierarchical -filter {NAME =~ *clk}
- The
- If the net connects directly to a top-level port,
get_portsreturns the top-level port; otherwise, it returns a hierarchical pin. - Limit netlist helper commands to the scope of the current instance by using
the following commands:
-
all_ffs -
all_latches -
all_rams -
all_registers -
all_dsps -
all_hsios
-
- Avoid I/O helper commands in scoped XDC files:
-
all_inputs -
all_outputs
-
- Clock commands are not scoped and returns all timing clocks of your
design.
-
get_clocks -
all_clocks
-
- Retrieve top-level or local clock by probing the netlist with
get_clocks -of_objects.- Use the following command for a clock entering the
current instance:
get_clocks -of_objects [get_ports <interfacePinName>] - Use the following command for a clock generated inside the current
instance, where
instNameis a clock generator instance:get_clocks -of_objects [get_pins <instName/outPin>]
- Use the following command for a clock entering the
current instance:
- Query objects in the design using a parent object context with the
-of_objectsoption:get_pins -leaf -of_objects [get_nets local_net] - Query top‑level ports connected to current instance interface
nets:
get_ports -of_objects [get_nets <scoped_instance_net>] - Avoid querying IP or sub‑module interface pins directly. For example,
get_pins clkreturns an error. - Scope path tracing commands so
all_faninandall_fanouttraverse only within the scoped design and stop at its boundary. - Target specific objects efficiently with
get_cells,get_pins, orget_nets. Use specific patterns instead of broad commands like the following:
Broad queries can return large collections of objects, which can negatively impact runtime.all_registers -clock