PyFPGA / pyfpga

A Python package to use FPGA development tools programmatically.
https://pyfpga.github.io/pyfpga/
GNU General Public License v3.0
81 stars 8 forks source link

File paths in TCL on Windows #41

Closed gts-bzi closed 2 weeks ago

gts-bzi commented 2 weeks ago

TCL requires paths (even on windows) to be in Posix format (forward slash over backslash). This can easily be resolved by forcing files to be stored in posix format:

        path = Path(file).resolve().as_posix()

https://github.com/PyFPGA/pyfpga/blob/c64e9f648295ebc79386853c3d0a633e324a00ac/pyfpga/project.py#L76

Verified to be working on Windows 10 with the current version of PyFPGA.

(Am unable to create pull requests at the moment so requesting through this issue :)

rodrigomelo9 commented 2 weeks ago

Hi @gts-bzi, thanks! It should be fixed now, could you try it? PS: it was a little more complex than the proposal (three methods modified; as_posix convert from Path to string)

gts-bzi commented 2 weeks ago

The issue itself seems fixed, however, either this other changes since the bug report have caused the TCL file to be weirdly formatted. It works, it just has a number of extraneous newlines. Will have to check later. Generated TCL attached. Tested with: fa84608232053ef59e84b6862954c45acb72f194

vivado.tcl.txt

rodrigomelo9 commented 2 weeks ago

The extra newlines are due to another thing that I'm working on. Thanks