41081 Chapter Notes - Chapter 5: Global Variable, Circular Buffer, The Queue
Chapter 5 – Concurrent synchSMs
Concurrent SynchSMs
• A task is a unique continuously executing behaviour.
• Concurrent tasks are tasks that execute at the same time.
• A block diagram shows each task as a block, and uses a directed line to show that
the block writes to an output or reads from an input.
• The multiple SynchSM model ticks the two nearly simultaneously, but there is a
small non-zero amount of time that may separate the ticks.
• Using multiple tabs on RIBS allows the capture of multiple tasks.
Shared Variables
• Soeties a sstes ehaiour is est aptured as ultiple tasks ee though the
are ot etirel idepedet, due to the tasks opleit.
• Only one task should have actions that write to a shared variable.
• A common error is to not ensure that tasks communicate robustly, leading to a
system that may sometimes work, but sometimes fails depending on the variations
that can occur with simultaneous ticks.
Converting Multiple SynchSMs to C
• Whe oertig SMs to C, the to tasks phsiall at tick concurrently and so
the process of serialisation occurs, known as multitasking.
• Executing each task in a straight forward form is called round-robin task execution.
• To convert a normal SM to a SynchSM, note:
o An SM task merely needs to be given a period.
o A sequential code task can be rewritten as a single state SM having that code
as its actions, and having a single true condition transition pointing back to
itself.
Converting SynchSM local variables to C
• A ariales sope refers to the regios of a system that can see that variable.
• The keord stati should e prepeded to a ShSM loal ariales.
find more resources at oneclass.com
find more resources at oneclass.com