Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDC plugin doesn't understand port indexes properly #13

Closed
mkurc-ant opened this issue May 7, 2020 · 5 comments · Fixed by #14
Closed

XDC plugin doesn't understand port indexes properly #13

mkurc-ant opened this issue May 7, 2020 · 5 comments · Fixed by #14

Comments

@mkurc-ant
Copy link
Collaborator

It's a TCL thing. When a port is retrieved using eg. [get_ports A[10]] the TCL parser treats the port index in square brackets as another TCL command and fails there. This prevents us from using stock XDC files. A workaround for that is to specify the port like [get_ports {A[10]}].

A fix may be doing some kind of pre-processing of XDCs prior to feeding them to the Yosys' TCL interpreter.

@mithro
Copy link
Collaborator

mithro commented May 7, 2020

See @whitequark's twitter for how Vivado solves this problem.

@mithro
Copy link
Collaborator

mithro commented May 7, 2020

https://twitter.com/whitequark/status/1256506061462409218?s=20

Twitter
“i discovered something disturbing, but you have to know Tcl to understand it. Vivado uses Tcl for scripting FPGA flows. Vivado allows using bracketed numbers in Tcl strings, e.g. [get_ports foo[1]] works. how? they made every integer a command that returns itself but bracketed”

@mithro
Copy link
Collaborator

mithro commented May 7, 2020

i discovered something disturbing, but you have to know Tcl to understand it.
Vivado uses Tcl for scripting FPGA flows. Vivado allows using bracketed numbers in Tcl strings, e.g. [get_ports foo[1]] works. how?
they made every integer a command that returns itself but bracketed

@whitequark
Copy link

You can override the [unknown] command to achieve this result.

@mkurc-ant
Copy link
Collaborator Author

Thanks, that's interesting and definitely worth a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants