Forum Discussion
Altera_Forum
Honored Contributor
11 years agoI wasn't aware of this limitation, but here we are still using Quartus II version 11.1... Where is this new limitation written?
Anyway, it's easy to implement your own recursive function for log2 in TCL, just the way you made it in HDL. I don't have a direct example for you, but I have something from one of my components that required an operation the other way round. I had a component that used a stream input for which the channel signal size was adjustable. The size was specified as number of bits as a module parameter, but for SOPC Builder I also needed to get the correct value for the "maxChannel" property of the Avalon stream input, or SOPC builder would complain if it didn't match the one of the source. So at the module level in the TCL file I specified that I had a custom elaboration function:set_module_property ELABORATION_CALLBACK elaboration And my elaboration function was as such: # elaboration callback
proc elaboration { } {
set chanbits
set maxchans
set_interface_property packets_in maxChannel $maxchans
}
You can use a similar construction, with a log2 function in the "expr" line instead of pow, and set_parameter_value instead of set_interface_property