xjtu.yohuang Posted October 4 Report Share Posted October 4 Hi, The IEEE1685-2014 standard says it utilizes SystemVerilog expressions as a means to specify an equation as the value of an element. In below example, there is a parameter my_param of 'byte' type, and its value is an expression (param_A - param_B): <ipxact:moduleParameters> <ipxact:moduleParameter type="byte"> <ipxact:name>my_param</ipxact:name> <ipxact:value>param_A - param_B</ipxact:value> </ipxact:moduleParameter> </ipxact:moduleParameters> Is it valid to set 32-bit value to param_A and param_B, e.g., param_A==0xFFFFFFFF and param_B==0xFFFFFFFE, whose computed value is 1? Should the expression parser convert param_A and param_B to byte type firstly and then do computation, or cast each operands to its int type and do int computation and convert the result to byte? thanks, Yohuang Quote Link to comment Share on other sites More sharing options...
kock Posted October 4 Report Share Posted October 4 Hi Yohuang, param_A and param_B should be casted to there own type and range first. Then the subtraction is applied and the result should be casted to the type and range of my_param. Please note that there is a newer version 1685-2022. Please use this version if you can because it supersedes 1685-2014. Best regards, Erwin Quote Link to comment Share on other sites More sharing options...
xjtu.yohuang Posted October 4 Author Report Share Posted October 4 Thanks for quick response. What if the my_param is of type int, and the ipxact:value looks like this: <ipxact:moduleParameters> <ipxact:moduleParameter type="int"> <ipxact:name>my_param</ipxact:name> <ipxact:value>0x100000000 - 0xFFFFFFFF</ipxact:value> </ipxact:moduleParameter> </ipxact:moduleParameters> Should systemVerilog parser cast up-cast both 0x100000000 (33bit) and 0xFFFFFFFF (32bit) to longint (64bit) and then cast the substraction result to int? >> Please note that there is a newer version 1685-2022. Please use this version if you can because it supersedes 1685-2014. Thanks for the suggestion, yes, I do have plan to move this newer version. Currently I'm doing some experiments with 1685-2014. thanks, Yohuang Quote Link to comment Share on other sites More sharing options...
kock Posted October 7 Report Share Posted October 7 Hi Yohuang, I need to read the SV on this. My understanding is that unsized constant numbers need to be represented as int (32 bit) and therefore the substraction is also represented as int (32 bits) (Section 11.6.1 and 11.6.2 in IEEE Std 1800-2012). So no up conversion to longint here. Best regards, Erwin Quote Link to comment Share on other sites More sharing options...
xjtu.yohuang Posted October 21 Author Report Share Posted October 21 Hi Kock, As IP-XACT expression does not support assign operators, the expressions compuation should be all self-determined for signess and size, right? If the above my_param is of long type, we will still compute the (0x100000000 - 0xFFFFFFFF) as signed int and the result will be converted to long then, right? thanks, Yohuang Quote Link to comment Share on other sites More sharing options...
kock Posted October 25 Report Share Posted October 25 Hello Yohang, Yes, as per my understanding, you are correct. If my_param is of type longint then the result will be casted to longint. Best regards, Erwin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.