Reference to an (evaluatable) constant value was expected instead of module parameter [message #1715404] |
Mon, 23 November 2015 11:32 |
Muhammad Uzair Messages: 35 Registered: November 2015 |
Member |
|
|
Hi,
I am having an error while compiling lte test cases. The scenario is as follows:
In module Common, there is following definition
modulepar charstring px_IMS_HomeDomainName := "3gpp.org";
In another module (in which above module is imported using import all), there is a definition:
const charstring tsc_DNS_DomainName := px_IMS_HomeDomainName;
When I am compiling this code, I am getting this error "Reference to an (evaluatable) constant value was expected instead of module parameter"
Apparently the the string is not being assigned to tsc_DNS_DomainName.
Is there anything wrong with the above code? Any help would be highly appreciated.
Thanks,
Muhammad Uzair
[Updated on: Mon, 23 November 2015 11:33] Report message to a moderator
|
|
|
Re: Reference to an (evaluatable) constant value was expected instead of module parameter [message #1715424 is a reply to message #1715404] |
Mon, 23 November 2015 13:52 |
|
Hi Muhammad,
this is a peculiarity of Titan:
-it is assumed that constants can be be initialized only with values and references that are known during compilation time
-module parameters are assumed to be unknown during compilation time as they can be overridden during runtime from values read from the config file (this permits changing module parameters without the need
to recompile)
this is the reason why constants cannot be initialized from module parameters in Titan, in slight opposition to the standard
The solution to this is some tweaking:
-either you change the constant to a (component) variable , bearing in mind that constants are global, while variables are local ( component -wide) in scope
-or change the constant to a module parameter , which can be initialized from another module parameter , but only in the config file, for the above reasons
Probably the first alternative is simpler
Best regards
Elemer
|
|
|
|
Powered by
FUDForum. Page generated in 0.03138 seconds