openXC7 / nextpnr-xilinx

Experimental flows using nextpnr for Xilinx devices
ISC License
36 stars 10 forks source link

Add validation/support for get_ports defined with brackets in XDC #16

Closed gh-sh4 closed 9 months ago

gh-sh4 commented 10 months ago

XDC files are sometimes distributed with get_ports arguments provided in {} brackets, and sometimes with spacing between brackets and the port name. For example, the Digilent Nexys Video which is a popular development board for Artix 7 is provided with XDC constraints defined this way. The current code only supports the case where no spacing is present, and fails cryptically otherwise. This change adds support for space between port names and brackets and outputs a message describing the supported get_ports parse formats if neither is found to work.

Closes issue #15

gh-sh4 commented 10 months ago

https://gist.github.com/gh-sh4/5a2f5bf088d4b460b0aaf7d06fdcfe0c

I also created a couple of gtest tests which validate this for both get_ports with and without spaces. Both tests pass, but I cannot include with this change since tests are submodule'd from another repository.