When you package IP for the Vivado IP catalog, include XDC constraints with the IP. Vivado Design Suite IP is plug-and-play, so you do not need a sample project or manual copy‑and‑paste of constraints. Write the XDC file as if the IP were a standalone, top-level design. Vivado automatically reads and scopes these constraints when you instantiate the IP from the catalog.
You can apply the same approach to any submodule of your design. Use the IP core
scoping mechanism by setting SCOPED_TO_REF or
SCOPED_TO_CELLS in the XDC file properties.
In a project flow, scope block‑level constraints to the block using file
properties. In non‑project mode, use the equivalent read_xdc -ref or
-cells options.