Jump to content
Sign in to follow this  
tudor.timi

Parameterizable enum missing

Recommended Posts

SystemVerilog had a cool features where it was possible to specify a sequence of enum literals:

typedef enum {
  SOME_LITERAL[10]
} some_enum;

This would generate an enum with the literals SOME_LITERAL0, SOME_LITERAL1, ..., SOME_LITERAL9.

This was pretty useful in building generic code that can deal with a configurable number of states, transfers, whatever. I noticed this feature is missing in the PSS. This could easily be supported in the DSL, but it's probably more difficult (if at all possible) to implement in C++. Is this the reason it's not in there? There are other sections in the document that specifically state that some feature is not available in the DSL/C++ version, so adding it do the DSL and not to C++ would be consistent.

Share this post


Link to post
Share on other sites

From PSWG:

Support for generated enumearage (e.g. 'typedef enum {sub[5]} myEnum;' that results in 5 enums sub0 thru sub4 with values 0 thru 4 respectively) could be added.  This functionality does not seem to be key to PSS but more of a  convenience.  Do not propose adding this functionality at present.

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...