]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
doc: add Singletasking and MultiTasking modes description
authorMichal Horn <hornmich@fel.cvut.cz>
Tue, 18 Aug 2015 10:51:46 +0000 (12:51 +0200)
committerMichal Horn <hornmich@fel.cvut.cz>
Wed, 19 Aug 2015 10:26:19 +0000 (12:26 +0200)
doc/rpp_simulink.tex

index 9794ccf626784b8e7324d86bb8b8632c401764d9..bb11e88b6ff1d13781a43a565ba46a8f780f7623 100644 (file)
@@ -1791,6 +1791,41 @@ downloader.
        \item[rpp/rpp] Contains set of support script for the Code Generator.
 \end{description}
 
+\section{SingleTasking and MultiTasking modes}
+\label{sec-singlet-multit-modes}
+This chapter describes the behavior of the SingleTasking and MultiTasking modes.
+The mode can be selected for every model in the configuration dialog as described
+in Section \ref{sec-crating-new-model}.
+
+For models which are running on a single rate the SingleTasking mode should be selected as there are
+no benefits from the MultiTasking mode.
+
+Once multiple rates appear in the model, the mode selection becomes more important as there may
+exist cases, depending on memory availability and timing, to prefer one of them.
+
+\subsection{SingleTasking}
+\label{sec-singlet-mode}
+In this mode every Simulink task, defined by its sample rate, is running in a single task (thread).
+This means that the speed of the fastest possible sample rate is limited by the longest execution
+time of every simulink tasks in the model. 
+
+The code generated in this mode is quite simple and much less memory demanding as there are only two
+operating system tasks and only few semaphores.
+
+\subsection{MultiTasking}
+\label{sec-multit-mode}
+In this mode every Simulink task, defined by its sample rate, is running in its own separated
+task (thread). Every task has automatically assigned a priority and tasks with higher priority
+are allowed to preempt tasks with lower priority. This means that the speed of the fastest sample rate
+period is limited only by the code execution speed of the control task, the task itself and operating
+system overhead.
+
+The tasks are assigned the priority according to the sample rate. By default the fastest sample rate gets the highest priority number and the priority number is incremented for every slower subrate. This behavior is in most cases wrong for the models driven by the RPP library with FreeRTOS. In this operating system the lower priority number means the lower priority of the task. By default the fastest subrate gets the lowest priority. To avoid this the checkbox \textit{TextHigher priority value indicates higher task priority} has to be checked in the model configuration dialog in the Solver pane. The checkbox makes the simulink to decrement the task priority number for every slower subrates, leaving the fastest sample rate with the highest priority.
+
+The code generated in this mode is however more comlicated than in the SingleTasking mode. The
+necessity of launching a task and defining a semaphore for every subrate brings higher
+demands on memory.
+
 \section{Block Library Overview}
 \label{sec-block-library-overview}
 The Simulink Block Library is a set of blocks that allows Simulink models to use