Forum Discussion
Altera_Forum
Honored Contributor
18 years ago --- Quote Start --- square brackets mean execute the command and return the value: > set sum [expr 3.0 + 4.0 + 5.0] > 12.0 Curly brackets mean everything inside should be take literally: > set sum {expr 3.0 + 4.0 +5.0} returns: > expr 3.0 + 4.0 + 5.0 (i.e. sum is a list, where the first member is expr, the second member is 3.0, etc. Quotation marks are used for a list also, but not as literal: >set sum "a [expr 3.0 + 4.0] b" sum is now a list, with the first member a, the second member 7.0, and the last member b The big problem is that Quartus(and most tools) use square brackets for node indices. So if you want a simple node: get_ports data get_ports "data" get_ports {data} all three of these are the same thing. But if grabbing a member of a bus: get_ports data[3] get_ports "data[3]" get_ports "data\[3\]" get_ports {data[3]" The first two will fail since it will try to execute the command 3. The second two will work with what you want. But if you're passing in a variable, you need to use quotes: get_ports "data\[$i\]" It takes a little getting used to, but all languages tend to be confusing in this area. (Or they're too strict and severely limited if they don't have lots of options.) --- Quote End --- Thanks very much for the detailed explaination. Is there any book about FPGA you have written? I think you are qualified for a writer.