Hi Gabriel,

Thanks for the detailed information. My enum is small, so I think this will
work just fine.

Regards,
Sampad

On Mon, Nov 8, 2021 at 6:43 AM Gabriel Busnot via gem5-users <
gem5-users@gem5.org> wrote:

> Hi Sampad,
>
> I don't think that you can import C++ enums in SLICC in a general and sage
> way. SLICC does not support "external enums" so any enum declared in SLICC
> will result in a C++ enum being generated under the gem5::ruby namespace.
>
> One way of safely using external enums (any namespace, scoped enums, etc.)
> is to:
>    - define functions that return the enum values you want to use (1
> function per enum value, ideally)
>    - declare these functions in a file included in RubySlicc_includes.hh
>    - declare the enum name as an external primitive type in SLICC (see
> RubySlicc_Exports.sm for an example)
>    - decalre the functions returning enum values in SLICC before using
> them.
>
> You won't be able to use the SLICC enum syntax but you should remain type
> and value safe accross C++ and SLICC.
>
> Regards,
> Gabriel
> _______________________________________________
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to