Jump to content

SystemC module parameter


Khushi

Recommended Posts

For folllowing SystemC module

template <typename T> // type parameter
class testModule : public sc_module {
public:
testModule(sc_module_name modnamemodname, string portname) {}

What is the correct representation of portname parameter in ipxact

<ipxact:moduleParameter parameterId="ip_config" resolve="user" type="string">
<ipxact:name>portname</ipxact:name>
<ipxact:value>ABC</ipxact:value> #without double quote
</ipxact:moduleParameter>

 

or

<ipxact:moduleParameter parameterId="ip_config" resolve="user" type="string">
<ipxact:name>portname</ipxact:name>
<ipxact:value>"ABC"</ipxact:value> #without double quote
</ipxact:moduleParameter>

If the correct way is without double quote(first option above) then how the tool decides wehther the value is actually "ABC" and not the another parameter value with parameter id ABC and vice versa

Thanks

Khushi

Link to comment
Share on other sites

  • 1 month later...

Hello

Do the value need to be in quoted string for parameters with type="string". For example

<ipxact:moduleParameter parameterId="ip_config" resolve="user" type="string">
<ipxact:name>portname</ipxact:name>
<ipxact:value>"ABC"</ipxact:value> #without double quote
</ipxact:moduleParameter>

If no, then how the tool determine if the value (ABC) is actual value or an expression based on another parameter id(ABC) ?

Thanks

Link to comment
Share on other sites

Since moduleParameter values are expressions, then string literals must be quoted, so this version is correct:

<ipxact:moduleParameter parameterId="ip_config" resolve="user" type="string">
  <ipxact:name>portname</ipxact:name>
  <ipxact:value>"ABC"</ipxact:value>
</ipxact:moduleParameter>

Otherwise, as you mentioned, a tool would parse the value and see ABC as an identifier (parameterId reference) which is not what you want.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...