Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [papyrus-rt-dev] Code generation questions (Papyrus-RT used in lecture)

Some answers inline below.

I hope this helps.


Regards,

Charles Rivet
Senior Product Manager, Papyrus-RT product leader

On 2017-11-08, at 04:38 , Ansgar Radermacher <ansgar.radermacher@xxxxxx> wrote:

Dear all,

the university of Darmstadt plans to use Papyrus-RT instead of a commercial tool in a lecture about real-time systems.

They asked me the following questions that they could not figure out in the documentation

- How to specify synchronous (blocking) invocations ?
<cr>
As a general note, one must be careful in the use of synchronous signals in real-time embedded systems because of their blocking behavior.

That being said, there are “invoke” methods defined in UML-RT, but they are not implemented in the Papyrus-RT Runtime Services Library (RTS).

Check out: 

  • int invoke ( UMLRTMessage * replyMsgs );
  • int invokeAt ( int index, UMLRTMessage * replyMsg );

In RTS files:


The stubs are there, but they are not implemented. If you want to write code these operations, we would be happy to incorporate it in the Papyrus-RT code base!

A workaround does exist in that you can boost the priority of the signals sent and received to simulate this functionality.

A “send” operation does have a field for the priority of the message:

  • bool send ( UMLRTPriority priority = PRIORITY_NORMAL ) const;

Where priority can be any of:

  • PRIORITY_SYNCHRONOUS = 0,
  • PRIORITY_SYSTEM,
  • PRIORITY_PANIC,
  • PRIORITY_HIGH,
  • PRIORITY_NORMAL,
  • PRIORITY_LOW,
  • PRIORITY_BACKGROUND,
  • PRIORITY_MAXPLUS1
By setting the priority at a high level, e.g., SYNCHRONOUS, the message will be one of the first processed as message queues as first processed in order of priority.


</cr>

- Is it possible to add additional #include to certain files?
<cr>
Yes there is. There are stereotype properties that allow you to do this. If you add the “CapsuleProperties” stereotype, you will find the ability to specify include files (header/implementation preface/ending).
</cr>

- Is it possible to add additional code that is executed at the beginning of the generated main method?
<cr>
If you mean before the main method is started, I don’t think so.

However, you can run code as part of the top capsule’s initial transition. At that point, the runtime system has been initialized and you would have access to all its services, but no other execution would have started.

This is the typical approach, for example, to read in command line parameters that could affect the system’s running configuration. There should be an example available on how to do this - let me know if this is of interest and I’ll find it for you.
</cr>

Best regards

Ansgar
_______________________________________________
papyrus-rt-dev mailing list
papyrus-rt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/papyrus-rt-dev


Back to the top