Topic
4 replies Latest Post - ‏2013-08-15T01:58:08Z by SHINJI
P1NK_Rhap
P1NK_Rhap
4 Posts
ACCEPTED ANSWER

Pinned topic Triggered Operations and Top-Down Optimization (MicroC)

‏2013-07-10T14:04:00Z |

Dear DW users,

I seem to be facing what seems to be a bug in Rhapsody 8 (not sure about previous versions though)

When you either use a custom triggered operation or the doExecute thread to trigger a transition on statechart, Rhapsody won't be able to build because of the C0265: 'doExecute' (or any other Triggered op) undeclared identifier

I tested with Rhapsody 8.0, 8.0.1, 8.0.2, 8.0.3

Of course when you set implementation of statecharts as Flat this problem won't occur, but since I want to design applications for high-constraint systems, I still would like to use the top-down optimization which reduces code size a lot

Has anyone else faced this problem before?

Thanks in advance,

Jerome

Updated on 2013-07-11T12:11:28Z at 2013-07-11T12:11:28Z by P1NK_Rhap
  • SHINJI
    SHINJI
    123 Posts
    ACCEPTED ANSWER

    Re: Triggered Operations and Top-Down Optimization (MicroC)

    ‏2013-08-13T00:34:36Z  in response to P1NK_Rhap

    Hello

    It looks like you're using Rhapsody C++ edition as you seem to be able to choose either "reusable" or "flat" in statechart implementation section. However, the title implies you're using MXF (Micro-C Framework)... Does it mean you imported Micro-C profile into C++ project and encountered the problem? Anyway, for me to tell more, I would like to take a look at your model that produces the C0265 error. 

    Just FYI, you can enable the generation of MISRA C++ compliant code, see the link below:

    http://pic.dhe.ibm.com/infocenter/rhaphlp/v8/topic/com.ibm.rhp.misra.doc/topics/t_misracpp.html

    --Shinji

  • P1NK_Rhap
    P1NK_Rhap
    4 Posts
    ACCEPTED ANSWER

    Re: Triggered Operations and Top-Down Optimization (MicroC)

    ‏2013-08-13T08:13:03Z  in response to P1NK_Rhap

    Hello,

    First, thanks for the answer, but I think you got it wrong:

    I do use Rhapsody for C, with the MicroC profile, but I do NOT chose between reusable and flat for statechart implementation.

    The MicroC profile allows you in your configuration's properties (that is: Properties, not Settings > C_CG::Configuration::Statechart_Implementation), to choose between Flat (using switch/case) and Top-Down Implementation (using if/else)

    The thing is, Top-Down produces a much compacter code, works overall fine but produces errors when using triggered operations

    There's no need of a particular model: Top-Down Implementation, one class, one statechart two states, one transition triggering on a Triggered Op. and here you go

    --Jerome

    • SHINJI
      SHINJI
      123 Posts
      ACCEPTED ANSWER

      Re: Triggered Operations and Top-Down Optimization (MicroC)

      ‏2013-08-14T03:54:57Z  in response to P1NK_Rhap

      Hello,

      I think you're right. I checked with Rhapsody v7.5/v7.6, I can easily reproduce the problem you mentioned. If I re-write the code manually as below, I can successfully compile and run the code even under animation. 

      Before: && ((<trigger operation name>))))
      After: && (id=<trigger operation name>_<class name>_Event_id)))

      Are you able to contact Rational Client Support to report this incident, referring to the this thread?

      Best Regards,

      --Shinji

      • SHINJI
        SHINJI
        123 Posts
        ACCEPTED ANSWER

        Re: Triggered Operations and Top-Down Optimization (MicroC)

        ‏2013-08-15T01:58:08Z  in response to SHINJI

        As you probably know already, this problem doesn't happen with File element. The concept of File is similar to Class element in RiC but one big difference is things defined in File is "global", therefore you don't see the scope identifier in the operation declaration (e.x File: trOpe(), Class: <class_name>_trOpe()). 

        Model by using files:
        http://pic.dhe.ibm.com/infocenter/rhaphlp/v8/topic/com.ibm.rhp.uml.diagrams.doc/topics/rhp_c_dm_model_by_using_files.html

        Another thing is that I can't even compile Stopwatch sample (using Micro-C profile) with Statechart_Implementation="OptimizedTopDown" setting. May be, it is working as designed and there might be consideration/limitation in modelling using MicroC I'm not aware of. Using v8.0.2, I had an issue compiling a File containing 3 states connected via events, which seems to be fixed in the following APAR. 

        http://www-01.ibm.com/support/docview.wss?uid=swg1PM87692

        Above all, I believe you will be best served by raising a PMR with RCS.

        --Shinji