Altera_Forum
Honored Contributor
11 years agoQsys: what version of Tcl?
I stumbled on the following:
In a _hw.tcl file I have the following code:proc elaborate {} {
send_message info "Tcl Command: Version: Patchlevel "
add_interface_port slave A address Input ]]
}
proc widthu { v } {
set r
if { != $v} {
incr r
}
return $r
}
proc widthr { v } {
return + 1 ]
}
proc log2 { v } {
set log2 0
if { $v == 1} {
return 0
} else {
return ] + 1]
}
} Yesterday I wanted to include the module in a Qsys project, but I got this error: --- Quote Start --- Error: System.I2CMMSlave_0: syntax error in expression "2 ** 14" while executing "expr 2 ** $r" ("if" test expression) invoked from within "if { [expr 2 ** $r] != $v} { incr r }" (procedure "widthu" line 3) invoked from within "widthu [get_parameter_value ADDRESS_SIZE] " invoked from within "expr [widthu [get_parameter_value ADDRESS_SIZE] " invoked from within "add_interface_port slave A address Input [expr [widthu [get_parameter_value ADDRESS_SIZE] ]]" (procedure "elaborate" line 3) invoked from within "elaborate" --- Quote End --- I then added the " send_message info "Tcl Command: Version: [info tclversion] Patchlevel [info patchlevel]" " to the elaborate procedure and was very surprised to get the following: --- Quote Start --- Info: System.I2CMMSlave_0: Tcl Command: Version: 8.0 Patchlevel 8.0 --- Quote End --- As I was expecting to see version 8.5 or 8.6. I did the exercise for Quartus 12.0, 13.0 SP1 and 14.1, and get the same error. Any clues why Qsys is reporting 8.0? Is Altera emulating Tcl 8.0 in its Java code? http://www.alteraforum.com/forum/attachment.php?attachmentid=9916&stc=1