modules.html 76.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Main modules &mdash; SimSo documentation</title>
    
    <link rel="stylesheet" href="_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
17
        VERSION:     '0.8',
18 19 20 21 22 23 24 25 26 27 28 29
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="SimSo documentation" href="index.html" />
    <link rel="next" title="Licenses" href="licenses.html" />
    <link rel="prev" title="Using SimSo in script mode" href="text_mode.html" /> 
  </head>
PE Hladik committed
30 31
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
32 33 34 35 36 37 38 39 40 41 42 43 44 45
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="licenses.html" title="Licenses"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="text_mode.html" title="Using SimSo in script mode"
             accesskey="P">previous</a> |</li>
PE Hladik committed
46
        <li class="nav-item nav-item-0"><a href="index.html">SimSo documentation</a> &raquo;</li> 
47 48 49 50 51
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
PE Hladik committed
52
          <div class="body" role="main">
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
            
  <div class="section" id="main-modules">
<h1><a class="toc-backref" href="#id3">Main modules</a><a class="headerlink" href="#main-modules" title="Permalink to this headline"></a></h1>
<div class="contents topic" id="table-of-contents">
<p class="topic-title first">Table of Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#main-modules" id="id3">Main modules</a><ul>
<li><a class="reference internal" href="#module-simso.core" id="id4">simso.core module</a><ul>
<li><a class="reference internal" href="#module-simso.core.Scheduler" id="id5">Scheduler</a></li>
<li><a class="reference internal" href="#module-simso.core.Task" id="id6">Task</a></li>
<li><a class="reference internal" href="#module-simso.core.Job" id="id7">Job</a></li>
<li><a class="reference internal" href="#module-simso.core.Model" id="id8">Model</a></li>
<li><a class="reference internal" href="#module-simso.core.Processor" id="id9">Processor</a></li>
<li><a class="reference internal" href="#module-simso.core.Timer" id="id10">Timer</a></li>
<li><a class="reference internal" href="#module-simso.core.Logger" id="id11">Logger</a></li>
<li><a class="reference internal" href="#module-simso.core.results" id="id12">results</a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-simso.configuration" id="id13">simso.configuration module</a><ul>
<li><a class="reference internal" href="#module-simso.configuration.Configuration" id="id14">Configuration</a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-simso.generator.task_generator" id="id15">simso.generator module</a></li>
<li><a class="reference internal" href="#simso-utils-module" id="id16">simso.utils module</a><ul>
<li><a class="reference internal" href="#module-simso.utils.PartitionedScheduler" id="id17">PartitionedScheduler</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="module-simso.core">
<span id="simso-core-module"></span><h2><a class="toc-backref" href="#id4">simso.core module</a><a class="headerlink" href="#module-simso.core" title="Permalink to this headline"></a></h2>
<p>The core module include all the classes needed for the simulation.</p>
<div class="section" id="module-simso.core.Scheduler">
<span id="scheduler"></span><h3><a class="toc-backref" href="#id5">Scheduler</a><a class="headerlink" href="#module-simso.core.Scheduler" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="simso.core.Scheduler.Scheduler">
PE Hladik committed
91
<em class="property">class </em><code class="descname">Scheduler</code><span class="sig-paren">(</span><em>sim</em>, <em>scheduler_info</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.Scheduler" title="Permalink to this definition"></a></dt>
92 93 94
<dd><p>The implementation of a scheduler is done by subclassing this abstract
class.</p>
<p>The scheduling events are modeled by method calls which take as arguments
PE Hladik committed
95
the <a class="reference internal" href="#simso.core.Job.Job" title="simso.core.Job.Job"><code class="xref py py-class docutils literal"><span class="pre">jobs</span></code></a> and the <a class="reference internal" href="#simso.core.Processor.Processor" title="simso.core.Processor.Processor"><code class="xref py py-class docutils literal"><span class="pre">processors</span></code></a>.</p>
96 97 98 99
<p>The following methods should be redefined in order to interact with the
simulation:</p>
<blockquote>
<div><ul class="simple">
PE Hladik committed
100 101 102 103
<li><a class="reference internal" href="#simso.core.Scheduler.Scheduler.init" title="simso.core.Scheduler.Scheduler.init"><code class="xref py py-meth docutils literal"><span class="pre">init()</span></code></a> Called when the simulation is ready. The scheduler         logic should be initialized here.</li>
<li><a class="reference internal" href="#simso.core.Scheduler.Scheduler.on_activate" title="simso.core.Scheduler.Scheduler.on_activate"><code class="xref py py-meth docutils literal"><span class="pre">on_activate()</span></code></a> Called upon a job activation.</li>
<li><a class="reference internal" href="#simso.core.Scheduler.Scheduler.on_terminated" title="simso.core.Scheduler.Scheduler.on_terminated"><code class="xref py py-meth docutils literal"><span class="pre">on_terminated()</span></code></a> Called when a job is terminated.</li>
<li><a class="reference internal" href="#simso.core.Scheduler.Scheduler.schedule" title="simso.core.Scheduler.Scheduler.schedule"><code class="xref py py-meth docutils literal"><span class="pre">schedule()</span></code></a> Take the scheduling decision. This method should         not be called directly. A call to the <a class="reference internal" href="#simso.core.Processor.Processor.resched" title="simso.core.Processor.Processor.resched"><code class="xref py py-meth docutils literal"><span class="pre">resched</span></code></a> method is required.</li>
104 105 106 107
</ul>
</div></blockquote>
<p>By default, the scheduler can only run on a single processor at the same
simulation time. It is also possible to override this behavior by
PE Hladik committed
108
overriding the <a class="reference internal" href="#simso.core.Scheduler.Scheduler.get_lock" title="simso.core.Scheduler.Scheduler.get_lock"><code class="xref py py-meth docutils literal"><span class="pre">get_lock()</span></code></a> and <a class="reference internal" href="#simso.core.Scheduler.Scheduler.release_lock" title="simso.core.Scheduler.Scheduler.release_lock"><code class="xref py py-meth docutils literal"><span class="pre">release_lock()</span></code></a> methods.</p>
109 110
<p>Args:</p>
<ul class="simple">
PE Hladik committed
111 112
<li><cite>sim</cite>: <a class="reference internal" href="#module-simso.core.Model" title="simso.core.Model"><code class="xref py py-class docutils literal"><span class="pre">Model</span></code></a> instance.</li>
<li><cite>scheduler_info</cite>: A <a class="reference internal" href="#simso.core.Scheduler.SchedulerInfo" title="simso.core.Scheduler.SchedulerInfo"><code class="xref py py-class docutils literal"><span class="pre">SchedulerInfo</span></code></a> representing the             scheduler.</li>
113 114 115
</ul>
<p>Attributes:</p>
<ul class="simple">
PE Hladik committed
116 117 118
<li><strong>sim</strong>: <a class="reference internal" href="#simso.core.Model.Model" title="simso.core.Model.Model"><code class="xref py py-class docutils literal"><span class="pre">Model</span></code></a> instance.             Useful to get current time with <code class="docutils literal"><span class="pre">sim.now_ms()</span></code> (in ms) or             <code class="docutils literal"><span class="pre">sim.now()</span></code> (in cycles).</li>
<li><strong>processors</strong>: List of <a class="reference internal" href="#simso.core.Processor.Processor" title="simso.core.Processor.Processor"><code class="xref py py-class docutils literal"><span class="pre">processors</span></code></a> handled by this scheduler.</li>
<li><strong>task_list</strong>: List of <a class="reference internal" href="#simso.core.Task.GenericTask" title="simso.core.Task.GenericTask"><code class="xref py py-class docutils literal"><span class="pre">tasks</span></code></a>             handled by this scheduler.</li>
119 120 121 122
</ul>
<p>Methods:</p>
<dl class="method">
<dt id="simso.core.Scheduler.Scheduler.add_processor">
PE Hladik committed
123
<code class="descname">add_processor</code><span class="sig-paren">(</span><em>cpu</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.Scheduler.add_processor" title="Permalink to this definition"></a></dt>
124 125 126 127
<dd><p>Add a processor to the list of processors handled by this scheduler.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
PE Hladik committed
128
<li><cite>processor</cite>: The <a class="reference internal" href="#simso.core.Processor.Processor" title="simso.core.Processor.Processor"><code class="xref py py-class docutils literal"><span class="pre">processor</span></code></a> to add.</li>
129 130 131 132 133 134 135
</ul>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="simso.core.Scheduler.Scheduler.add_task">
PE Hladik committed
136
<code class="descname">add_task</code><span class="sig-paren">(</span><em>task</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.Scheduler.add_task" title="Permalink to this definition"></a></dt>
137 138 139 140
<dd><p>Add a task to the list of tasks handled by this scheduler.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
PE Hladik committed
141
<li><cite>task</cite>: The <a class="reference internal" href="#simso.core.Task.GenericTask" title="simso.core.Task.GenericTask"><code class="xref py py-class docutils literal"><span class="pre">task</span></code></a> to add.</li>
142 143 144 145 146 147 148
</ul>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="simso.core.Scheduler.Scheduler.get_lock">
PE Hladik committed
149
<code class="descname">get_lock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.Scheduler.get_lock" title="Permalink to this definition"></a></dt>
150 151 152 153 154 155
<dd><p>Implement a lock mechanism. Override it to remove the lock or change
its behavior.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.Scheduler.Scheduler.init">
PE Hladik committed
156
<code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.Scheduler.init" title="Permalink to this definition"></a></dt>
157 158 159 160 161 162 163 164
<dd><p>This method is called when the system is ready to run. This method
should be used in lieu of the __init__ method. This method is
guaranteed to be called when the simulation starts, after the tasks
are instantiated</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.Scheduler.Scheduler.on_activate">
PE Hladik committed
165
<code class="descname">on_activate</code><span class="sig-paren">(</span><em>job</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.Scheduler.on_activate" title="Permalink to this definition"></a></dt>
166 167 168 169
<dd><p>This method is called upon a job activation.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
PE Hladik committed
170
<li><cite>job</cite>: The activated <a class="reference internal" href="#simso.core.Job.Job" title="simso.core.Job.Job"><code class="xref py py-class docutils literal"><span class="pre">job</span></code></a>.</li>
171 172 173 174 175 176 177
</ul>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="simso.core.Scheduler.Scheduler.on_terminated">
PE Hladik committed
178
<code class="descname">on_terminated</code><span class="sig-paren">(</span><em>job</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.Scheduler.on_terminated" title="Permalink to this definition"></a></dt>
179 180 181 182
<dd><p>This method is called when a job finish (termination or abortion).</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
PE Hladik committed
183
<li><cite>job</cite>: The <a class="reference internal" href="#simso.core.Job.Job" title="simso.core.Job.Job"><code class="xref py py-class docutils literal"><span class="pre">job</span></code></a> that terminates .</li>
184 185 186 187 188 189 190
</ul>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="simso.core.Scheduler.Scheduler.release_lock">
PE Hladik committed
191 192
<code class="descname">release_lock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.Scheduler.release_lock" title="Permalink to this definition"></a></dt>
<dd><p>Release the lock. Goes in pair with <a class="reference internal" href="#simso.core.Scheduler.Scheduler.get_lock" title="simso.core.Scheduler.Scheduler.get_lock"><code class="xref py py-meth docutils literal"><span class="pre">get_lock()</span></code></a>.</p>
193 194 195 196
</dd></dl>

<dl class="method">
<dt id="simso.core.Scheduler.Scheduler.schedule">
PE Hladik committed
197
<code class="descname">schedule</code><span class="sig-paren">(</span><em>cpu</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.Scheduler.schedule" title="Permalink to this definition"></a></dt>
198 199 200 201 202
<dd><p>The schedule method must be redefined by the simulated scheduler.
It takes as argument the cpu on which the scheduler runs.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
PE Hladik committed
203
<li><cite>cpu</cite>: The <a class="reference internal" href="#simso.core.Processor.Processor" title="simso.core.Processor.Processor"><code class="xref py py-class docutils literal"><span class="pre">processor</span></code></a>             on which the scheduler runs.</li>
204 205 206 207 208 209 210 211 212 213 214
</ul>
</dd>
</dl>
<p>Returns a decision or a list of decisions. A decision is a couple
(job, cpu).</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="simso.core.Scheduler.SchedulerInfo">
PE Hladik committed
215
<em class="property">class </em><code class="descname">SchedulerInfo</code><span class="sig-paren">(</span><em>clas=''</em>, <em>overhead=0</em>, <em>overhead_activate=0</em>, <em>overhead_terminate=0</em>, <em>fields=None</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.SchedulerInfo" title="Permalink to this definition"></a></dt>
216 217 218 219 220 221 222 223 224 225 226 227 228 229
<dd><p>SchedulerInfo groups the data that characterize a Scheduler (such as the
scheduling overhead) and do the dynamic loading of the scheduler.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>name</cite>: Name of the scheduler.</li>
<li><cite>cls</cite>: Class associated to this scheduler.</li>
<li><cite>overhead</cite>: Overhead associated to a scheduling decision.</li>
</ul>
</dd>
</dl>
<p>Methods:</p>
<dl class="method">
<dt id="simso.core.Scheduler.SchedulerInfo.get_cls">
PE Hladik committed
230
<code class="descname">get_cls</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.SchedulerInfo.get_cls" title="Permalink to this definition"></a></dt>
231 232 233 234 235
<dd><p>Get the class of this scheduler.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.Scheduler.SchedulerInfo.instantiate">
PE Hladik committed
236 237
<code class="descname">instantiate</code><span class="sig-paren">(</span><em>model</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Scheduler.SchedulerInfo.instantiate" title="Permalink to this definition"></a></dt>
<dd><p>Instantiate the <a class="reference internal" href="#simso.core.Scheduler.Scheduler" title="simso.core.Scheduler.Scheduler"><code class="xref py py-class docutils literal"><span class="pre">Scheduler</span></code></a> class.</p>
238 239 240
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
PE Hladik committed
241
<li><cite>model</cite>: The <a class="reference internal" href="#simso.core.Model.Model" title="simso.core.Model.Model"><code class="xref py py-class docutils literal"><span class="pre">Model</span></code></a> object             that is passed to the constructor.</li>
242 243 244 245 246 247 248 249 250 251 252 253
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-simso.core.Task">
<span id="task"></span><h3><a class="toc-backref" href="#id6">Task</a><a class="headerlink" href="#module-simso.core.Task" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="simso.core.Task.ATask">
PE Hladik committed
254 255
<em class="property">class </em><code class="descname">ATask</code><span class="sig-paren">(</span><em>sim</em>, <em>task_info</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Task.ATask" title="Permalink to this definition"></a></dt>
<dd><p>Non-periodic Task process. Inherits from <a class="reference internal" href="#simso.core.Task.GenericTask" title="simso.core.Task.GenericTask"><code class="xref py py-class docutils literal"><span class="pre">GenericTask</span></code></a>. The job is
256 257 258
created by another task.</p>
<p>Args:</p>
<ul class="simple">
PE Hladik committed
259 260
<li><cite>sim</cite>: <a class="reference internal" href="#module-simso.core.Model" title="simso.core.Model"><code class="xref py py-class docutils literal"><span class="pre">Model</span></code></a> instance.</li>
<li><cite>task_info</cite>: A <a class="reference internal" href="#simso.core.Task.TaskInfo" title="simso.core.Task.TaskInfo"><code class="xref py py-class docutils literal"><span class="pre">TaskInfo</span></code></a> representing the Task.</li>
261 262 263 264 265 266 267 268 269 270 271
</ul>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
</tbody>
</table>
</dd></dl>

<dl class="class">
<dt id="simso.core.Task.GenericTask">
PE Hladik committed
272 273
<em class="property">class </em><code class="descname">GenericTask</code><span class="sig-paren">(</span><em>sim</em>, <em>task_info</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Task.GenericTask" title="Permalink to this definition"></a></dt>
<dd><p>Abstract class for Tasks. <a class="reference internal" href="#simso.core.Task.ATask" title="simso.core.Task.ATask"><code class="xref py py-class docutils literal"><span class="pre">ATask</span></code></a> and <a class="reference internal" href="#simso.core.Task.PTask" title="simso.core.Task.PTask"><code class="xref py py-class docutils literal"><span class="pre">PTask</span></code></a> inherits from
274 275 276 277 278 279 280 281 282
this class.</p>
<p>These classes simulate the behavior of the simulated task. It controls the
release of the jobs and is able to abort the jobs that exceed their
deadline.</p>
<p>The majority of the task_info attributes are available through this class
too. A set of metrics such as the number of preemptions and migrations are
available for analysis.</p>
<p>Args:</p>
<ul class="simple">
PE Hladik committed
283 284
<li><cite>sim</cite>: <a class="reference internal" href="#module-simso.core.Model" title="simso.core.Model"><code class="xref py py-class docutils literal"><span class="pre">Model</span></code></a> instance.</li>
<li><cite>task_info</cite>: A <a class="reference internal" href="#simso.core.Task.TaskInfo" title="simso.core.Task.TaskInfo"><code class="xref py py-class docutils literal"><span class="pre">TaskInfo</span></code></a> representing the Task.</li>
285 286 287 288 289 290 291 292 293
</ul>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
</tbody>
</table>
<dl class="method">
<dt id="simso.core.Task.GenericTask.create_job">
PE Hladik committed
294
<code class="descname">create_job</code><span class="sig-paren">(</span><em>pred=None</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Task.GenericTask.create_job" title="Permalink to this definition"></a></dt>
295 296 297 298 299 300
<dd><p>Create a new job from this task. This should probably not be used
directly by a scheduler.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Task.GenericTask.data">
PE Hladik committed
301
<code class="descname">data</code><a class="headerlink" href="#simso.core.Task.GenericTask.data" title="Permalink to this definition"></a></dt>
302 303 304 305 306
<dd><p>Extra data to characterize the task. Only used by the scheduler.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Task.GenericTask.deadline">
PE Hladik committed
307
<code class="descname">deadline</code><a class="headerlink" href="#simso.core.Task.GenericTask.deadline" title="Permalink to this definition"></a></dt>
308 309 310 311 312
<dd><p>Deadline in milliseconds.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Task.GenericTask.followed_by">
PE Hladik committed
313
<code class="descname">followed_by</code><a class="headerlink" href="#simso.core.Task.GenericTask.followed_by" title="Permalink to this definition"></a></dt>
314 315 316 317 318
<dd><p>Task that is activated by the end of a job from this task.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Task.GenericTask.identifier">
PE Hladik committed
319
<code class="descname">identifier</code><a class="headerlink" href="#simso.core.Task.GenericTask.identifier" title="Permalink to this definition"></a></dt>
320 321 322 323 324
<dd><p>Identifier of the task.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Task.GenericTask.jobs">
PE Hladik committed
325
<code class="descname">jobs</code><a class="headerlink" href="#simso.core.Task.GenericTask.jobs" title="Permalink to this definition"></a></dt>
326 327 328 329 330
<dd><p>List of the jobs.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Task.GenericTask.monitor">
PE Hladik committed
331
<code class="descname">monitor</code><a class="headerlink" href="#simso.core.Task.GenericTask.monitor" title="Permalink to this definition"></a></dt>
332 333 334 335 336 337
<dd><p>The monitor for this Task. Similar to a log mechanism (see Monitor in
SimPy doc).</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Task.GenericTask.period">
PE Hladik committed
338
<code class="descname">period</code><a class="headerlink" href="#simso.core.Task.GenericTask.period" title="Permalink to this definition"></a></dt>
339 340 341 342 343
<dd><p>Period of the task.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Task.GenericTask.wcet">
PE Hladik committed
344
<code class="descname">wcet</code><a class="headerlink" href="#simso.core.Task.GenericTask.wcet" title="Permalink to this definition"></a></dt>
345 346 347 348 349 350 351
<dd><p>Worst-Case Execution Time in milliseconds.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="simso.core.Task.PTask">
PE Hladik committed
352 353
<em class="property">class </em><code class="descname">PTask</code><span class="sig-paren">(</span><em>sim</em>, <em>task_info</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Task.PTask" title="Permalink to this definition"></a></dt>
<dd><p>Periodic Task process. Inherits from <a class="reference internal" href="#simso.core.Task.GenericTask" title="simso.core.Task.GenericTask"><code class="xref py py-class docutils literal"><span class="pre">GenericTask</span></code></a>. The jobs are
354 355 356
created periodically.</p>
<p>Args:</p>
<ul class="simple">
PE Hladik committed
357 358
<li><cite>sim</cite>: <a class="reference internal" href="#module-simso.core.Model" title="simso.core.Model"><code class="xref py py-class docutils literal"><span class="pre">Model</span></code></a> instance.</li>
<li><cite>task_info</cite>: A <a class="reference internal" href="#simso.core.Task.TaskInfo" title="simso.core.Task.TaskInfo"><code class="xref py py-class docutils literal"><span class="pre">TaskInfo</span></code></a> representing the Task.</li>
359 360 361 362 363 364 365 366 367 368 369
</ul>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
</tbody>
</table>
</dd></dl>

<dl class="class">
<dt id="simso.core.Task.SporadicTask">
PE Hladik committed
370 371
<em class="property">class </em><code class="descname">SporadicTask</code><span class="sig-paren">(</span><em>sim</em>, <em>task_info</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Task.SporadicTask" title="Permalink to this definition"></a></dt>
<dd><p>Sporadic Task process. Inherits from <a class="reference internal" href="#simso.core.Task.GenericTask" title="simso.core.Task.GenericTask"><code class="xref py py-class docutils literal"><span class="pre">GenericTask</span></code></a>. The jobs are
372 373 374
created using a list of activation dates.</p>
<p>Args:</p>
<ul class="simple">
PE Hladik committed
375 376
<li><cite>sim</cite>: <a class="reference internal" href="#module-simso.core.Model" title="simso.core.Model"><code class="xref py py-class docutils literal"><span class="pre">Model</span></code></a> instance.</li>
<li><cite>task_info</cite>: A <a class="reference internal" href="#simso.core.Task.TaskInfo" title="simso.core.Task.TaskInfo"><code class="xref py py-class docutils literal"><span class="pre">TaskInfo</span></code></a> representing the Task.</li>
377 378 379 380 381 382 383 384 385 386 387
</ul>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="simso.core.Task.Task">
PE Hladik committed
388
<code class="descname">Task</code><span class="sig-paren">(</span><em>sim</em>, <em>task_info</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Task.Task" title="Permalink to this definition"></a></dt>
389 390 391 392 393 394
<dd><p>Task factory. Return and instantiate the correct class according to the
task_info.</p>
</dd></dl>

<dl class="class">
<dt id="simso.core.Task.TaskInfo">
PE Hladik committed
395
<em class="property">class </em><code class="descname">TaskInfo</code><span class="sig-paren">(</span><em>name</em>, <em>identifier</em>, <em>task_type</em>, <em>abort_on_miss</em>, <em>period</em>, <em>activation_date</em>, <em>n_instr</em>, <em>mix</em>, <em>stack_file</em>, <em>wcet</em>, <em>acet</em>, <em>et_stddev</em>, <em>deadline</em>, <em>base_cpi</em>, <em>followed_by</em>, <em>list_activation_dates</em>, <em>preemption_cost</em>, <em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Task.TaskInfo" title="Permalink to this definition"></a></dt>
396 397
<dd><p>TaskInfo is mainly a container class grouping the data that characterize
a Task. A list of TaskInfo objects are passed to the Model so that
PE Hladik committed
398
<a class="reference internal" href="#simso.core.Task.Task" title="simso.core.Task.Task"><code class="xref py py-class docutils literal"><span class="pre">Task</span></code></a> instances can be created.</p>
399 400 401 402 403 404 405 406
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
</tbody>
</table>
<dl class="attribute">
<dt id="simso.core.Task.TaskInfo.csdp">
PE Hladik committed
407
<code class="descname">csdp</code><a class="headerlink" href="#simso.core.Task.TaskInfo.csdp" title="Permalink to this definition"></a></dt>
408 409 410 411 412 413
<dd><p>Accumulated Stack Distance Profile. Used by the cache models instead of
the Stack Distance Profile for optimization matters.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.Task.TaskInfo.set_stack_file">
PE Hladik committed
414
<code class="descname">set_stack_file</code><span class="sig-paren">(</span><em>stack_file</em>, <em>cur_dir</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Task.TaskInfo.set_stack_file" title="Permalink to this definition"></a></dt>
415 416 417 418 419
<dd><p>Set the stack distance profile.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Task.TaskInfo.stack_file">
PE Hladik committed
420
<code class="descname">stack_file</code><a class="headerlink" href="#simso.core.Task.TaskInfo.stack_file" title="Permalink to this definition"></a></dt>
421 422 423 424 425 426 427 428 429 430
<dd><p>Stack distance profile input file.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-simso.core.Job">
<span id="job"></span><h3><a class="toc-backref" href="#id7">Job</a><a class="headerlink" href="#module-simso.core.Job" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="simso.core.Job.Job">
PE Hladik committed
431
<em class="property">class </em><code class="descname">Job</code><span class="sig-paren">(</span><em>task</em>, <em>name</em>, <em>pred</em>, <em>monitor</em>, <em>etm</em>, <em>sim</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Job.Job" title="Permalink to this definition"></a></dt>
432 433 434 435 436
<dd><p>The Job class simulate the behavior of a real Job. This <em>should</em> only be
instantiated by a Task.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
PE Hladik committed
437
<li><cite>task</cite>: The parent <a class="reference internal" href="#simso.core.Task.Task" title="simso.core.Task.Task"><code class="xref py py-class docutils literal"><span class="pre">task</span></code></a>.</li>
438 439 440 441
<li><cite>name</cite>: The name for this job.</li>
<li><cite>pred</cite>: If the task is not periodic, pred is the job that             released this one.</li>
<li><cite>monitor</cite>: A monitor is an object that log in time.</li>
<li><cite>etm</cite>: The execution time model.</li>
PE Hladik committed
442
<li><cite>sim</cite>: <a class="reference internal" href="#module-simso.core.Model" title="simso.core.Model"><code class="xref py py-class docutils literal"><span class="pre">Model</span></code></a> instance.</li>
443 444 445 446 447 448 449 450 451 452 453
</ul>
</dd>
</dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
</tbody>
</table>
<dl class="method">
<dt id="simso.core.Job.Job.abort">
PE Hladik committed
454
<code class="descname">abort</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Job.Job.abort" title="Permalink to this definition"></a></dt>
455 456 457 458 459 460 461
<dd><p>Abort this job. Warning, this is currently only used by the Task when
the job exceeds its deadline. It has not be tested from outside, such
as from the scheduler.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.aborted">
PE Hladik committed
462
<code class="descname">aborted</code><a class="headerlink" href="#simso.core.Job.Job.aborted" title="Permalink to this definition"></a></dt>
463 464 465 466 467 468 469 470 471 472 473 474 475
<dd><p>True if the job has been aborted.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.absolute_deadline">
PE Hladik committed
476
<code class="descname">absolute_deadline</code><a class="headerlink" href="#simso.core.Job.Job.absolute_deadline" title="Permalink to this definition"></a></dt>
477 478 479 480 481 482
<dd><p>Absolute deadline in milliseconds for this job. This is the activation
date + the relative deadline.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.activation_date">
PE Hladik committed
483
<code class="descname">activation_date</code><a class="headerlink" href="#simso.core.Job.Job.activation_date" title="Permalink to this definition"></a></dt>
484 485 486 487
<dd><p>Activation date in milliseconds for this job.</p>
</dd></dl>

<dl class="attribute">
488
<dt id="simso.core.Job.Job.actual_computation_time">
PE Hladik committed
489
<code class="descname">actual_computation_time</code><a class="headerlink" href="#simso.core.Job.Job.actual_computation_time" title="Permalink to this definition"></a></dt>
490 491 492 493 494
<dd><p>Computation time in ms as if the processor speed was 1.0 during the
whole execution.</p>
</dd></dl>

<dl class="attribute">
495
<dt id="simso.core.Job.Job.actual_computation_time_cycles">
PE Hladik committed
496
<code class="descname">actual_computation_time_cycles</code><a class="headerlink" href="#simso.core.Job.Job.actual_computation_time_cycles" title="Permalink to this definition"></a></dt>
497 498 499 500 501
<dd><p>Computation time as if the processor speed was 1.0 during the whole
execution.</p>
</dd></dl>

<dl class="attribute">
502
<dt id="simso.core.Job.Job.computation_time">
PE Hladik committed
503
<code class="descname">computation_time</code><a class="headerlink" href="#simso.core.Job.Job.computation_time" title="Permalink to this definition"></a></dt>
504 505 506 507 508
<dd><p>Time spent executing the job in ms.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.computation_time_cycles">
PE Hladik committed
509
<code class="descname">computation_time_cycles</code><a class="headerlink" href="#simso.core.Job.Job.computation_time_cycles" title="Permalink to this definition"></a></dt>
510 511 512 513
<dd><p>Time spent executing the job.</p>
</dd></dl>

<dl class="attribute">
514
<dt id="simso.core.Job.Job.cpu">
PE Hladik committed
515 516 517
<code class="descname">cpu</code><a class="headerlink" href="#simso.core.Job.Job.cpu" title="Permalink to this definition"></a></dt>
<dd><p>The <a class="reference internal" href="#simso.core.Processor.Processor" title="simso.core.Processor.Processor"><code class="xref py py-class docutils literal"><span class="pre">processor</span></code></a> on which the
job is attached. Equivalent to <code class="docutils literal"><span class="pre">self.task.cpu</span></code>.</p>
518 519 520 521
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.data">
PE Hladik committed
522
<code class="descname">data</code><a class="headerlink" href="#simso.core.Job.Job.data" title="Permalink to this definition"></a></dt>
523
<dd><p>The extra data specified for the task. Equivalent to
PE Hladik committed
524
<code class="docutils literal"><span class="pre">self.task.data</span></code>.</p>
525 526 527 528
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.deadline">
PE Hladik committed
529
<code class="descname">deadline</code><a class="headerlink" href="#simso.core.Job.Job.deadline" title="Permalink to this definition"></a></dt>
530
<dd><p>Relative deadline in milliseconds.
PE Hladik committed
531
Equivalent to <code class="docutils literal"><span class="pre">self.task.deadline</span></code>.</p>
532 533 534 535
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.end_date">
PE Hladik committed
536
<code class="descname">end_date</code><a class="headerlink" href="#simso.core.Job.Job.end_date" title="Permalink to this definition"></a></dt>
537 538 539 540 541
<dd><p>Date (in ms) when this job finished its execution.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.exceeded_deadline">
PE Hladik committed
542
<code class="descname">exceeded_deadline</code><a class="headerlink" href="#simso.core.Job.Job.exceeded_deadline" title="Permalink to this definition"></a></dt>
543 544 545 546 547 548
<dd><p>True if the end_date is greater than the deadline or if the job was
aborted.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.Job.Job.is_active">
PE Hladik committed
549
<code class="descname">is_active</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Job.Job.is_active" title="Permalink to this definition"></a></dt>
550 551 552 553 554
<dd><p>Return True if the job is still active.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.Job.Job.is_running">
PE Hladik committed
555
<code class="descname">is_running</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Job.Job.is_running" title="Permalink to this definition"></a></dt>
556
<dd><p>Return True if the job is currently running on a processor.
PE Hladik committed
557
Equivalent to <code class="docutils literal"><span class="pre">self.cpu.running</span> <span class="pre">==</span> <span class="pre">self</span></code>.</p>
558 559 560 561 562 563 564 565 566 567 568
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="attribute">
569
<dt id="simso.core.Job.Job.laxity">
PE Hladik committed
570
<code class="descname">laxity</code><a class="headerlink" href="#simso.core.Job.Job.laxity" title="Permalink to this definition"></a></dt>
571 572 573 574
<dd><p>Dynamic laxity of the job in ms.</p>
</dd></dl>

<dl class="attribute">
575
<dt id="simso.core.Job.Job.period">
PE Hladik committed
576 577
<code class="descname">period</code><a class="headerlink" href="#simso.core.Job.Job.period" title="Permalink to this definition"></a></dt>
<dd><p>Period in milliseconds. Equivalent to <code class="docutils literal"><span class="pre">self.task.period</span></code>.</p>
578 579 580 581
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.ret">
PE Hladik committed
582
<code class="descname">ret</code><a class="headerlink" href="#simso.core.Job.Job.ret" title="Permalink to this definition"></a></dt>
583
<dd><p>Remaining execution time in ms.</p>
584 585 586 587
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.start_date">
PE Hladik committed
588
<code class="descname">start_date</code><a class="headerlink" href="#simso.core.Job.Job.start_date" title="Permalink to this definition"></a></dt>
589 590 591 592 593 594
<dd><p>Date (in ms) when this job started executing
(different than the activation).</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.task">
PE Hladik committed
595 596
<code class="descname">task</code><a class="headerlink" href="#simso.core.Job.Job.task" title="Permalink to this definition"></a></dt>
<dd><p>The <a class="reference internal" href="#simso.core.Task.Task" title="simso.core.Task.Task"><code class="xref py py-class docutils literal"><span class="pre">task</span></code></a> for this job.</p>
597 598 599 600
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Job.Job.wcet">
PE Hladik committed
601
<code class="descname">wcet</code><a class="headerlink" href="#simso.core.Job.Job.wcet" title="Permalink to this definition"></a></dt>
602
<dd><p>Worst-Case Execution Time in milliseconds.
PE Hladik committed
603
Equivalent to <code class="docutils literal"><span class="pre">self.task.wcet</span></code>.</p>
604 605 606 607 608 609 610 611 612
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-simso.core.Model">
<span id="model"></span><h3><a class="toc-backref" href="#id8">Model</a><a class="headerlink" href="#module-simso.core.Model" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="simso.core.Model.Model">
PE Hladik committed
613
<em class="property">class </em><code class="descname">Model</code><span class="sig-paren">(</span><em>configuration</em>, <em>callback=None</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Model.Model" title="Permalink to this definition"></a></dt>
614 615 616 617 618 619
<dd><p>Main class for the simulation. It instantiate the various components
required by the simulation and run it.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>callback</cite>: A callback can be specified. This function will be                 called to report the advance of the simulation (useful for a                 progression bar).</li>
PE Hladik committed
620
<li><cite>configuration</cite>: The <a class="reference internal" href="#module-simso.configuration.Configuration" title="simso.configuration.Configuration"><code class="xref py py-class docutils literal"><span class="pre">configuration</span></code></a> of the simulation.</li>
621 622 623 624 625 626
</ul>
</dd>
</dl>
<p>Methods:</p>
<dl class="attribute">
<dt id="simso.core.Model.Model.cycles_per_ms">
PE Hladik committed
627
<code class="descname">cycles_per_ms</code><a class="headerlink" href="#simso.core.Model.Model.cycles_per_ms" title="Permalink to this definition"></a></dt>
628 629 630 631 632 633
<dd><p>Number of cycles per milliseconds. A cycle is the internal unit used
by SimSo. However, the tasks are defined using milliseconds.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Model.Model.duration">
PE Hladik committed
634
<code class="descname">duration</code><a class="headerlink" href="#simso.core.Model.Model.duration" title="Permalink to this definition"></a></dt>
635 636 637 638 639
<dd><p>Duration of the simulation.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Model.Model.etm">
PE Hladik committed
640
<code class="descname">etm</code><a class="headerlink" href="#simso.core.Model.Model.etm" title="Permalink to this definition"></a></dt>
641 642 643 644 645
<dd><p>Execution Time Model</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Model.Model.logs">
PE Hladik committed
646 647
<code class="descname">logs</code><a class="headerlink" href="#simso.core.Model.Model.logs" title="Permalink to this definition"></a></dt>
<dd><p>All the logs from the <a class="reference internal" href="#simso.core.Logger.Logger" title="simso.core.Logger.Logger"><code class="xref py py-class docutils literal"><span class="pre">Logger</span></code></a>.</p>
648 649 650 651
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Model.Model.processors">
PE Hladik committed
652
<code class="descname">processors</code><a class="headerlink" href="#simso.core.Model.Model.processors" title="Permalink to this definition"></a></dt>
653 654 655 656 657
<dd><p>List of all the processors.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.Model.Model.run_model">
PE Hladik committed
658
<code class="descname">run_model</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Model.Model.run_model" title="Permalink to this definition"></a></dt>
659 660 661 662 663
<dd><p>Execute the simulation.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Model.Model.task_list">
PE Hladik committed
664
<code class="descname">task_list</code><a class="headerlink" href="#simso.core.Model.Model.task_list" title="Permalink to this definition"></a></dt>
665 666 667 668 669 670 671 672 673 674
<dd><p>List of all the tasks.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-simso.core.Processor">
<span id="processor"></span><h3><a class="toc-backref" href="#id9">Processor</a><a class="headerlink" href="#module-simso.core.Processor" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="simso.core.Processor.Processor">
PE Hladik committed
675
<em class="property">class </em><code class="descname">Processor</code><span class="sig-paren">(</span><em>model</em>, <em>proc_info</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Processor.Processor" title="Permalink to this definition"></a></dt>
676 677 678 679 680
<dd><p>A processor is responsible of deciding whether the simulated processor
should execute a job or execute the scheduler. There is one instance of
Processor per simulated processor. Those are responsible to call the
scheduler methods.</p>
<p>When a scheduler needs to take a scheduling decision, it must invoke the
PE Hladik committed
681
<a class="reference internal" href="#simso.core.Processor.Processor.resched" title="simso.core.Processor.Processor.resched"><code class="xref py py-meth docutils literal"><span class="pre">resched()</span></code></a> method. This is typically done in the <a class="reference internal" href="#simso.core.Scheduler.Scheduler.on_activate" title="simso.core.Scheduler.Scheduler.on_activate"><code class="xref py py-meth docutils literal"><span class="pre">on_activate</span></code></a>, <a class="reference internal" href="#simso.core.Scheduler.Scheduler.on_terminated" title="simso.core.Scheduler.Scheduler.on_terminated"><code class="xref py py-meth docutils literal"><span class="pre">on_terminated</span></code></a> or in a <a class="reference internal" href="#simso.core.Timer.Timer" title="simso.core.Timer.Timer"><code class="xref py py-class docutils literal"><span class="pre">timer</span></code></a> handler.</p>
682 683
<dl class="attribute">
<dt id="simso.core.Processor.Processor.internal_id">
PE Hladik committed
684
<code class="descname">internal_id</code><a class="headerlink" href="#simso.core.Processor.Processor.internal_id" title="Permalink to this definition"></a></dt>
685 686 687 688 689
<dd><p>A unique, internal, id.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.Processor.Processor.is_running">
PE Hladik committed
690
<code class="descname">is_running</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Processor.Processor.is_running" title="Permalink to this definition"></a></dt>
691 692 693 694 695
<dd><p>Return True if a job is currently running on that processor.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.Processor.Processor.resched">
PE Hladik committed
696
<code class="descname">resched</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Processor.Processor.resched" title="Permalink to this definition"></a></dt>
697 698 699 700 701
<dd><p>Add a resched event to the list of events to handle.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Processor.Processor.running">
PE Hladik committed
702
<code class="descname">running</code><a class="headerlink" href="#simso.core.Processor.Processor.running" title="Permalink to this definition"></a></dt>
703 704 705 706 707 708 709 710 711 712 713
<dd><p>The job currently running on that processor. None if no job is
currently running on the processor.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-simso.core.Timer">
<span id="timer"></span><h3><a class="toc-backref" href="#id10">Timer</a><a class="headerlink" href="#module-simso.core.Timer" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="simso.core.Timer.Timer">
PE Hladik committed
714
<em class="property">class </em><code class="descname">Timer</code><span class="sig-paren">(</span><em>sim</em>, <em>function</em>, <em>args</em>, <em>delay</em>, <em>one_shot=True</em>, <em>prior=False</em>, <em>cpu=None</em>, <em>in_ms=True</em>, <em>overhead=0</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Timer.Timer" title="Permalink to this definition"></a></dt>
715 716 717 718 719 720 721 722 723 724 725 726
<dd><p>Allow to declare a timer. A timer is a mechanism that allows to call a
function after a certain amount of time, periodically or single shot.</p>
<p>A Timer can be used with or without specifying a processor. If a processor
is specified, when the timer fire, if a job was running on the processor,
it is temporarly interrupted. This is more realistic, even if for the
moment there is no overhead associated to this action. A scheduler using a
timer should define on which processor the callback will execute.</p>
<p>The delay is expressed in milliseconds by default but it can also be given
in cycles.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
PE Hladik committed
727
<li><cite>sim</cite>: The <a class="reference internal" href="#simso.core.Model.Model" title="simso.core.Model.Model"><code class="xref py py-class docutils literal"><span class="pre">model</span></code></a> object.</li>
728 729 730 731 732
<li><cite>function</cite>: Callback function, called when the delay expires.</li>
<li><cite>args</cite>: Arguments passed to the callback function.</li>
<li><cite>delay</cite>: Time to wait before calling the function.</li>
<li><cite>one_shot</cite>: True if the timer should execute only once.</li>
<li><cite>prior</cite>: If true, for the same date, the simulation should             start by handling the timer (should probably not be True).</li>
PE Hladik committed
733
<li><cite>cpu</cite>: On which <a class="reference internal" href="#simso.core.Processor.Processor" title="simso.core.Processor.Processor"><code class="xref py py-class docutils literal"><span class="pre">processor</span></code></a> the function is virtually             executing.</li>
734 735 736 737 738 739 740
<li><cite>in_ms</cite>: True if the delay is expressed in millisecond. In             cycles otherwise.</li>
</ul>
</dd>
</dl>
<p>Methods:</p>
<dl class="method">
<dt id="simso.core.Timer.Timer.start">
PE Hladik committed
741
<code class="descname">start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Timer.Timer.start" title="Permalink to this definition"></a></dt>
742 743 744 745 746
<dd><p>Start the timer.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.Timer.Timer.stop">
PE Hladik committed
747
<code class="descname">stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Timer.Timer.stop" title="Permalink to this definition"></a></dt>
748 749 750 751 752 753 754 755 756 757
<dd><p>Stop the timer.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-simso.core.Logger">
<span id="logger"></span><h3><a class="toc-backref" href="#id11">Logger</a><a class="headerlink" href="#module-simso.core.Logger" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="simso.core.Logger.Logger">
PE Hladik committed
758
<em class="property">class </em><code class="descname">Logger</code><span class="sig-paren">(</span><em>sim</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Logger.Logger" title="Permalink to this definition"></a></dt>
759
<dd><p>Simple logger. Every message is logged with its date.</p>
PE Hladik committed
760 761 762 763 764 765 766
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>sim</cite>: The <a class="reference internal" href="#simso.core.Model.Model" title="simso.core.Model.Model"><code class="xref py py-class docutils literal"><span class="pre">model</span></code></a> object.</li>
</ul>
</dd>
</dl>
767 768
<dl class="method">
<dt id="simso.core.Logger.Logger.log">
PE Hladik committed
769
<code class="descname">log</code><span class="sig-paren">(</span><em>msg</em>, <em>kernel=False</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.Logger.Logger.log" title="Permalink to this definition"></a></dt>
770 771 772 773 774 775 776 777 778 779 780 781 782
<dd><p>Log the message <cite>msg</cite>.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>msg</cite>: The message to log.</li>
<li><cite>kernel</cite>: Allows to make a distinction between a message from             the core of the simulation or from the scheduler.</li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.Logger.Logger.logs">
PE Hladik committed
783
<code class="descname">logs</code><a class="headerlink" href="#simso.core.Logger.Logger.logs" title="Permalink to this definition"></a></dt>
784 785 786 787 788 789 790 791 792 793
<dd><p>The logs, a SimPy Monitor object.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-simso.core.results">
<span id="results"></span><h3><a class="toc-backref" href="#id12">results</a><a class="headerlink" href="#module-simso.core.results" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="simso.core.results.JobR">
PE Hladik committed
794
<em class="property">class </em><code class="descname">JobR</code><span class="sig-paren">(</span><em>date</em>, <em>job</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.results.JobR" title="Permalink to this definition"></a></dt>
795 796 797 798 799 800
<dd><p>Add a set of metrics to a job. Such metrics include: preemption count,
migration count, response time, etc.</p>
</dd></dl>

<dl class="class">
<dt id="simso.core.results.ProcessorR">
PE Hladik committed
801
<em class="property">class </em><code class="descname">ProcessorR</code><a class="headerlink" href="#simso.core.results.ProcessorR" title="Permalink to this definition"></a></dt>
802 803 804 805 806 807
<dd><p>Add information about a processor such as the number of CxtSave and
CxtLoad and their total overhead.</p>
</dd></dl>

<dl class="class">
<dt id="simso.core.results.Results">
PE Hladik committed
808
<em class="property">class </em><code class="descname">Results</code><span class="sig-paren">(</span><em>model</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.results.Results" title="Permalink to this definition"></a></dt>
809 810 811 812 813 814 815 816 817 818 819 820 821 822
<dd><p>This class embeds and analyzes all the results from the simulation.
This allows to retrieve the usual metrics.</p>
<dl class="docutils">
<dt>The Results instance object contains the following attributes:</dt>
<dd><ul class="first last simple">
<li><cite>tasks</cite>: a dictionary of TaskR where the key is the original Task.</li>
<li><cite>scheduler</cite>: a SchedulerR instance.</li>
<li><cite>processors</cite>: a dictionary of ProcessorR where the key is the             original Processor.</li>
</ul>
</dd>
</dl>
<p>.</p>
<dl class="method">
<dt id="simso.core.results.Results.calc_load">
PE Hladik committed
823
<code class="descname">calc_load</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.results.Results.calc_load" title="Permalink to this definition"></a></dt>
824 825 826 827 828
<dd><p>Yield a tuple (proc, load, overhead) for each processor.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.results.Results.get_observation_window">
PE Hladik committed
829
<code class="descname">get_observation_window</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.results.Results.get_observation_window" title="Permalink to this definition"></a></dt>
830 831 832 833 834
<dd><p>Get the observation window.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.core.results.Results.observation_window">
PE Hladik committed
835
<code class="descname">observation_window</code><a class="headerlink" href="#simso.core.results.Results.observation_window" title="Permalink to this definition"></a></dt>
836 837 838 839 840
<dd><p>Get the observation window.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.results.Results.set_observation_window">
PE Hladik committed
841
<code class="descname">set_observation_window</code><span class="sig-paren">(</span><em>window</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.results.Results.set_observation_window" title="Permalink to this definition"></a></dt>
842 843 844 845 846 847
<dd><p>Set the observation window. The events that occurs outside of the
observation window are discarded.</p>
</dd></dl>

<dl class="method">
<dt id="simso.core.results.Results.tasks_event">
PE Hladik committed
848
<code class="descname">tasks_event</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.results.Results.tasks_event" title="Permalink to this definition"></a></dt>
849 850 851 852 853 854 855
<dd><p>Generator of the tasks events sorted by their date.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="simso.core.results.SchedulerR">
PE Hladik committed
856
<em class="property">class </em><code class="descname">SchedulerR</code><a class="headerlink" href="#simso.core.results.SchedulerR" title="Permalink to this definition"></a></dt>
857 858 859 860 861 862
<dd><p>Add information about the scheduler such as the number of scheduling
events and their total overhead.</p>
</dd></dl>

<dl class="class">
<dt id="simso.core.results.TaskR">
PE Hladik committed
863
<em class="property">class </em><code class="descname">TaskR</code><span class="sig-paren">(</span><em>task</em>, <em>delta_preemption=100</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.core.results.TaskR" title="Permalink to this definition"></a></dt>
864 865 866 867 868 869 870 871 872 873 874 875 876
<dd><p>Add a set of metrics to a task. These metrics include: task_migrations,
abortion count, etc.</p>
<p>The attribute jobs contains a list of JobR, sorted by activation date.</p>
</dd></dl>

</div>
</div>
<div class="section" id="module-simso.configuration">
<span id="simso-configuration-module"></span><h2><a class="toc-backref" href="#id13">simso.configuration module</a><a class="headerlink" href="#module-simso.configuration" title="Permalink to this headline"></a></h2>
<div class="section" id="module-simso.configuration.Configuration">
<span id="configuration"></span><h3><a class="toc-backref" href="#id14">Configuration</a><a class="headerlink" href="#module-simso.configuration.Configuration" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="simso.configuration.Configuration.Configuration">
PE Hladik committed
877
<em class="property">class </em><code class="descname">Configuration</code><span class="sig-paren">(</span><em>filename=None</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.configuration.Configuration.Configuration" title="Permalink to this definition"></a></dt>
878 879
<dd><p>The configuration class store all the details about a system. An instance
of this class will be passed to the constructor of the
PE Hladik committed
880 881 882 883 884 885 886 887
<a class="reference internal" href="#simso.core.Model.Model" title="simso.core.Model.Model"><code class="xref py py-class docutils literal"><span class="pre">Model</span></code></a> class.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>filename</cite> A file can be used to initialize the configuration.</li>
</ul>
</dd>
</dl>
888 889
<dl class="method">
<dt id="simso.configuration.Configuration.Configuration.add_processor">
PE Hladik committed
890
<code class="descname">add_processor</code><span class="sig-paren">(</span><em>name</em>, <em>identifier</em>, <em>cs_overhead=0</em>, <em>cl_overhead=0</em>, <em>migration_overhead=0</em>, <em>speed=1.0</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.configuration.Configuration.Configuration.add_processor" title="Permalink to this definition"></a></dt>
891 892 893 894 895 896
<dd><p>Helper method to create a ProcInfo and add it to the list of
processors.</p>
</dd></dl>

<dl class="method">
<dt id="simso.configuration.Configuration.Configuration.add_task">
PE Hladik committed
897
<code class="descname">add_task</code><span class="sig-paren">(</span><em>name</em>, <em>identifier</em>, <em>task_type='Periodic'</em>, <em>abort_on_miss=True</em>, <em>period=10</em>, <em>activation_date=0</em>, <em>n_instr=0</em>, <em>mix=0.5</em>, <em>stack_file=''</em>, <em>wcet=0</em>, <em>acet=0</em>, <em>et_stddev=0</em>, <em>deadline=10</em>, <em>base_cpi=1.0</em>, <em>followed_by=None</em>, <em>list_activation_dates=[]</em>, <em>preemption_cost=0</em>, <em>data=None</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.configuration.Configuration.Configuration.add_task" title="Permalink to this definition"></a></dt>
898 899 900 901 902
<dd><p>Helper method to create a TaskInfo and add it to the list of tasks.</p>
</dd></dl>

<dl class="method">
<dt id="simso.configuration.Configuration.Configuration.check_all">
PE Hladik committed
903
<code class="descname">check_all</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.configuration.Configuration.Configuration.check_all" title="Permalink to this definition"></a></dt>
904 905 906 907 908
<dd><p>Check the correctness of the configuration (without simulating it).</p>
</dd></dl>

<dl class="method">
<dt id="simso.configuration.Configuration.Configuration.get_hyperperiod">
PE Hladik committed
909
<code class="descname">get_hyperperiod</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#simso.configuration.Configuration.Configuration.get_hyperperiod" title="Permalink to this definition"></a></dt>
910 911 912 913 914
<dd><p>Compute and return the hyperperiod of the tasks.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.configuration.Configuration.Configuration.proc_info_list">
PE Hladik committed
915
<code class="descname">proc_info_list</code><a class="headerlink" href="#simso.configuration.Configuration.Configuration.proc_info_list" title="Permalink to this definition"></a></dt>
916 917 918 919 920
<dd><p>List of processors (ProcInfo objects).</p>
</dd></dl>

<dl class="method">
<dt id="simso.configuration.Configuration.Configuration.save">
PE Hladik committed
921
<code class="descname">save</code><span class="sig-paren">(</span><em>simulation_file=None</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.configuration.Configuration.Configuration.save" title="Permalink to this definition"></a></dt>
922 923 924 925 926 927 928
<dd><p>Save the current configuration in a file. If no file is given as
argument, the previous file used to write or read the configuration is
used again.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.configuration.Configuration.Configuration.scheduler_info">
PE Hladik committed
929
<code class="descname">scheduler_info</code><a class="headerlink" href="#simso.configuration.Configuration.Configuration.scheduler_info" title="Permalink to this definition"></a></dt>
930 931 932 933 934
<dd><p>SchedulerInfo object.</p>
</dd></dl>

<dl class="attribute">
<dt id="simso.configuration.Configuration.Configuration.task_info_list">
PE Hladik committed
935
<code class="descname">task_info_list</code><a class="headerlink" href="#simso.configuration.Configuration.Configuration.task_info_list" title="Permalink to this definition"></a></dt>
936 937 938 939 940 941 942 943 944 945 946 947
<dd><p>List of tasks (TaskInfo objects).</p>
</dd></dl>

</dd></dl>

</div>
</div>
<div class="section" id="module-simso.generator.task_generator">
<span id="simso-generator-module"></span><h2><a class="toc-backref" href="#id15">simso.generator module</a><a class="headerlink" href="#module-simso.generator.task_generator" title="Permalink to this headline"></a></h2>
<p>Tools for generating task sets.</p>
<dl class="function">
<dt id="simso.generator.task_generator.StaffordRandFixedSum">
PE Hladik committed
948
<code class="descname">StaffordRandFixedSum</code><span class="sig-paren">(</span><em>n</em>, <em>u</em>, <em>nsets</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.generator.task_generator.StaffordRandFixedSum" title="Permalink to this definition"></a></dt>
949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991
<dd><p>Copyright 2010 Paul Emberson, Roger Stafford, Robert Davis.
All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:</p>
<ol class="arabic">
<li><dl class="first docutils">
<dt>Redistributions of source code must retain the above copyright notice,</dt>
<dd><p class="first last">this list of conditions and the following disclaimer.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>Redistributions in binary form must reproduce the above copyright notice,</dt>
<dd><p class="first last">this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.</p>
</dd>
</dl>
</li>
</ol>
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS <a href="#id1"><span class="problematic" id="id2">``</span></a>AS IS&#8217;&#8217; AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
<p>The views and conclusions contained in the software and documentation are
those of the authors and should not be interpreted as representing official
policies, either expressed or implied, of Paul Emberson, Roger Stafford or
Robert Davis.</p>
<p>Includes Python implementation of Roger Stafford&#8217;s randfixedsum implementation
<a class="reference external" href="http://www.mathworks.com/matlabcentral/fileexchange/9700">http://www.mathworks.com/matlabcentral/fileexchange/9700</a>
Adapted specifically for the purpose of taskset generation with fixed
total utilisation value</p>
<p>Please contact <a class="reference external" href="mailto:paule&#37;&#52;&#48;rapitasystems&#46;com">paule<span>&#64;</span>rapitasystems<span>&#46;</span>com</a> or <a class="reference external" href="mailto:robdavis&#37;&#52;&#48;cs&#46;york&#46;ac&#46;uk">robdavis<span>&#64;</span>cs<span>&#46;</span>york<span>&#46;</span>ac<span>&#46;</span>uk</a> if you have
any questions regarding this software.</p>
</dd></dl>

<dl class="function">
<dt id="simso.generator.task_generator.gen_kato_utilizations">
PE Hladik committed
992
<code class="descname">gen_kato_utilizations</code><span class="sig-paren">(</span><em>nsets</em>, <em>umin</em>, <em>umax</em>, <em>target_util</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.generator.task_generator.gen_kato_utilizations" title="Permalink to this definition"></a></dt>
993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007
<dd><p>Kato et al. tasksets generator.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>nsets</cite>: Number of tasksets to generate.</li>
<li><cite>umin</cite>: Minimum task utilization.</li>
<li><cite>umax</cite>: Maximum task utilization.</li>
<li><cite>target_util</cite>:</li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="simso.generator.task_generator.gen_periods_discrete">
PE Hladik committed
1008
<code class="descname">gen_periods_discrete</code><span class="sig-paren">(</span><em>n</em>, <em>nsets</em>, <em>periods</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.generator.task_generator.gen_periods_discrete" title="Permalink to this definition"></a></dt>
1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023
<dd><p>Generate a matrix of (nsets x n) random periods chosen randomly in the
list of periods.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>n</cite>: The number of tasks in a task set.</li>
<li><cite>nsets</cite>: Number of sets to generate.</li>
<li><cite>periods</cite>: A list of available periods.</li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="simso.generator.task_generator.gen_periods_loguniform">
PE Hladik committed
1024
<code class="descname">gen_periods_loguniform</code><span class="sig-paren">(</span><em>n</em>, <em>nsets</em>, <em>min_</em>, <em>max_</em>, <em>round_to_int=False</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.generator.task_generator.gen_periods_loguniform" title="Permalink to this definition"></a></dt>
1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040
<dd><p>Generate a list of <cite>nsets</cite> sets containing each <cite>n</cite> random periods using a
loguniform distribution.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>n</cite>: The number of tasks in a task set.</li>
<li><cite>nsets</cite>: Number of sets to generate.</li>
<li><cite>min_</cite>: Period min.</li>
<li><cite>max_</cite>: Period max.</li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="simso.generator.task_generator.gen_periods_uniform">
PE Hladik committed
1041
<code class="descname">gen_periods_uniform</code><span class="sig-paren">(</span><em>n</em>, <em>nsets</em>, <em>min_</em>, <em>max_</em>, <em>round_to_int=False</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.generator.task_generator.gen_periods_uniform" title="Permalink to this definition"></a></dt>
1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057
<dd><p>Generate a list of <cite>nsets</cite> sets containing each <cite>n</cite> random periods using a
uniform distribution.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>n</cite>: The number of tasks in a task set.</li>
<li><cite>nsets</cite>: Number of sets to generate.</li>
<li><cite>min_</cite>: Period min.</li>
<li><cite>max_</cite>: Period max.</li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="simso.generator.task_generator.gen_randfixedsum">
PE Hladik committed
1058
<code class="descname">gen_randfixedsum</code><span class="sig-paren">(</span><em>nsets</em>, <em>u</em>, <em>n</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.generator.task_generator.gen_randfixedsum" title="Permalink to this definition"></a></dt>
1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074
<dd><p>Stafford&#8217;s RandFixedSum algorithm implementated in Python.</p>
<p>Based on the Python implementation given by Paul Emberson, Roger Stafford,
and Robert Davis. Available under the Simplified BSD License.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>n</cite>: The number of tasks in a task set.</li>
<li><cite>u</cite>: Total utilization of the task set.</li>
<li><cite>nsets</cite>: Number of sets to generate.</li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="simso.generator.task_generator.gen_ripoll">
PE Hladik committed
1075
<code class="descname">gen_ripoll</code><span class="sig-paren">(</span><em>nsets</em>, <em>compute</em>, <em>deadline</em>, <em>period</em>, <em>target_util</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.generator.task_generator.gen_ripoll" title="Permalink to this definition"></a></dt>
1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091
<dd><p>Ripoll et al. tasksets generator.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>nsets</cite>: Number of tasksets to generate.</li>
<li><cite>compute</cite>: Maximum computation time of a task.</li>
<li><cite>deadline</cite>: Maximum slack time.</li>
<li><cite>period</cite>: Maximum delay after the deadline.</li>
<li><cite>target_util</cite>: Total utilization to reach.</li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="simso.generator.task_generator.gen_tasksets">
PE Hladik committed
1092
<code class="descname">gen_tasksets</code><span class="sig-paren">(</span><em>utilizations</em>, <em>periods</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.generator.task_generator.gen_tasksets" title="Permalink to this definition"></a></dt>
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122
<dd><p>Take a list of task utilization sets and a list of task period sets and
return a list of couples (c, p) sets. The computation times are truncated
at a precision of 10^-10 to avoid floating point precision errors.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last">
<li><p class="first"><cite>utilization</cite>: The list of task utilization sets. For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[[</span><span class="mf">0.3</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="mf">0.8</span><span class="p">],</span> <span class="p">[</span><span class="mf">0.1</span><span class="p">,</span> <span class="mf">0.9</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">]]</span>
</pre></div>
</div>
</li>
<li><p class="first"><cite>periods</cite>: The list of task period sets. For examples:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="p">[[</span><span class="mi">100</span><span class="p">,</span> <span class="mi">50</span><span class="p">,</span> <span class="mi">1000</span><span class="p">],</span> <span class="p">[</span><span class="mi">200</span><span class="p">,</span> <span class="mi">500</span><span class="p">,</span> <span class="mi">10</span><span class="p">]]</span>
</pre></div>
</div>
</li>
</ul>
</dd>
<dt>Returns:</dt>
<dd><p class="first">For the above example, it returns:</p>
<div class="last highlight-python"><div class="highlight"><pre><span class="p">[[(</span><span class="mf">30.0</span><span class="p">,</span> <span class="mi">100</span><span class="p">),</span> <span class="p">(</span><span class="mf">20.0</span><span class="p">,</span> <span class="mi">50</span><span class="p">),</span> <span class="p">(</span><span class="mf">800.0</span><span class="p">,</span> <span class="mi">1000</span><span class="p">)],</span>
 <span class="p">[(</span><span class="mf">20.0</span><span class="p">,</span> <span class="mi">200</span><span class="p">),</span> <span class="p">(</span><span class="mf">450.0</span><span class="p">,</span> <span class="mi">500</span><span class="p">),</span> <span class="p">(</span><span class="mf">5.0</span><span class="p">,</span> <span class="mi">10</span><span class="p">)]]</span>
</pre></div>
</div>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="simso.generator.task_generator.gen_uunifastdiscard">
PE Hladik committed
1123
<code class="descname">gen_uunifastdiscard</code><span class="sig-paren">(</span><em>nsets</em>, <em>u</em>, <em>n</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.generator.task_generator.gen_uunifastdiscard" title="Permalink to this definition"></a></dt>
1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149
<dd><p>The UUniFast algorithm was proposed by Bini for generating task
utilizations on uniprocessor architectures.</p>
<p>The UUniFast-Discard algorithm extends it to multiprocessor by
discarding task sets containing any utilization that exceeds 1.</p>
<p>This algorithm is easy and widely used. However, it suffers from very
long computation times when n is close to u. Stafford&#8217;s algorithm is
faster.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
<li><cite>n</cite>: The number of tasks in a task set.</li>
<li><cite>u</cite>: Total utilization of the task set.</li>
<li><cite>nsets</cite>: Number of sets to generate.</li>
</ul>
</dd>
</dl>
<p>Returns <cite>nsets</cite> of <cite>n</cite> task utilizations.</p>
</dd></dl>

</div>
<div class="section" id="simso-utils-module">
<h2><a class="toc-backref" href="#id16">simso.utils module</a><a class="headerlink" href="#simso-utils-module" title="Permalink to this headline"></a></h2>
<div class="section" id="module-simso.utils.PartitionedScheduler">
<span id="partitionedscheduler"></span><h3><a class="toc-backref" href="#id17">PartitionedScheduler</a><a class="headerlink" href="#module-simso.utils.PartitionedScheduler" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt id="simso.utils.PartitionedScheduler.PartitionedScheduler">
PE Hladik committed
1150
<em class="property">class </em><code class="descname">PartitionedScheduler</code><span class="sig-paren">(</span><em>sim</em>, <em>scheduler_info</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.utils.PartitionedScheduler.PartitionedScheduler" title="Permalink to this definition"></a></dt>
1151 1152 1153 1154 1155
<dd><p>The PartitionedScheduler class provide facilities to create a new
Partitioned Scheduler. Only the packing phase is not done and should
be overriden.</p>
<p>Args:</p>
<ul class="simple">
PE Hladik committed
1156 1157
<li><cite>sim</cite>: <a class="reference internal" href="#module-simso.core.Model" title="simso.core.Model"><code class="xref py py-class docutils literal"><span class="pre">Model</span></code></a> instance.</li>
<li><cite>scheduler_info</cite>: A <code class="xref py py-class docutils literal"><span class="pre">SchedulerInfo</span></code> representing the             scheduler.</li>
1158 1159 1160
</ul>
<p>Attributes:</p>
<ul class="simple">
PE Hladik committed
1161 1162 1163
<li><strong>sim</strong>: <a class="reference internal" href="#simso.core.Model.Model" title="simso.core.Model.Model"><code class="xref py py-class docutils literal"><span class="pre">Model</span></code></a> instance.             Useful to get current time with <code class="docutils literal"><span class="pre">sim.now_ms()</span></code> (in ms) or             <code class="docutils literal"><span class="pre">sim.now()</span></code> (in cycles).</li>
<li><strong>processors</strong>: List of <a class="reference internal" href="#simso.core.Processor.Processor" title="simso.core.Processor.Processor"><code class="xref py py-class docutils literal"><span class="pre">processors</span></code></a> handled by this scheduler.</li>
<li><strong>task_list</strong>: List of <a class="reference internal" href="#simso.core.Task.GenericTask" title="simso.core.Task.GenericTask"><code class="xref py py-class docutils literal"><span class="pre">tasks</span></code></a>             handled by this scheduler.</li>
1164 1165 1166 1167
</ul>
<p>Methods:</p>
<dl class="method">
<dt id="simso.utils.PartitionedScheduler.PartitionedScheduler.init">
PE Hladik committed
1168
<code class="descname">init</code><span class="sig-paren">(</span><em>scheduler_info</em>, <em>packer=None</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.utils.PartitionedScheduler.PartitionedScheduler.init" title="Permalink to this definition"></a></dt>
1169 1170 1171
<dd><dl class="docutils">
<dt>Args:</dt>
<dd><ul class="first last simple">
PE Hladik committed
1172
<li><cite>scheduler_info</cite>: A <a class="reference internal" href="#simso.core.Scheduler.SchedulerInfo" title="simso.core.Scheduler.SchedulerInfo"><code class="xref py py-class docutils literal"><span class="pre">SchedulerInfo</span></code></a> object. One scheduler from             this SchedulerInfo will be instantiated for each processor.</li>
1173 1174 1175 1176 1177 1178 1179 1180 1181
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="simso.utils.PartitionedScheduler.best_fit">
PE Hladik committed
1182
<code class="descname">best_fit</code><span class="sig-paren">(</span><em>scheduler</em>, <em>task_list=None</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.utils.PartitionedScheduler.best_fit" title="Permalink to this definition"></a></dt>
1183 1184 1185 1186 1187 1188
<dd><p>Best-Fit heuristic. Put the tasks somewhere it fits but with the least
spare place.</p>
</dd></dl>

<dl class="function">
<dt id="simso.utils.PartitionedScheduler.decreasing_best_fit">
PE Hladik committed
1189
<code class="descname">decreasing_best_fit</code><span class="sig-paren">(</span><em>scheduler</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.utils.PartitionedScheduler.decreasing_best_fit" title="Permalink to this definition"></a></dt>
1190 1191 1192 1193 1194
<dd><p>Best-Fit with tasks inversely sorted by their u_i.</p>
</dd></dl>

<dl class="function">
<dt id="simso.utils.PartitionedScheduler.decreasing_first_fit">
PE Hladik committed
1195
<code class="descname">decreasing_first_fit</code><span class="sig-paren">(</span><em>scheduler</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.utils.PartitionedScheduler.decreasing_first_fit" title="Permalink to this definition"></a></dt>
1196 1197 1198 1199 1200
<dd><p>First-Fit with tasks inversely sorted by their u_i.</p>
</dd></dl>

<dl class="function">
<dt id="simso.utils.PartitionedScheduler.decreasing_next_fit">
PE Hladik committed
1201
<code class="descname">decreasing_next_fit</code><span class="sig-paren">(</span><em>scheduler</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.utils.PartitionedScheduler.decreasing_next_fit" title="Permalink to this definition"></a></dt>
1202 1203 1204 1205 1206
<dd><p>Next-Fit with tasks inversely sorted by their u_i.</p>
</dd></dl>

<dl class="function">
<dt id="simso.utils.PartitionedScheduler.decreasing_worst_fit">
PE Hladik committed
1207
<code class="descname">decreasing_worst_fit</code><span class="sig-paren">(</span><em>scheduler</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.utils.PartitionedScheduler.decreasing_worst_fit" title="Permalink to this definition"></a></dt>
1208 1209 1210 1211 1212
<dd><p>Worst-Fit with tasks inversely sorted by their u_i.</p>
</dd></dl>

<dl class="function">
<dt id="simso.utils.PartitionedScheduler.first_fit">
PE Hladik committed
1213
<code class="descname">first_fit</code><span class="sig-paren">(</span><em>scheduler</em>, <em>task_list=None</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.utils.PartitionedScheduler.first_fit" title="Permalink to this definition"></a></dt>
1214 1215 1216 1217 1218 1219
<dd><p>First-Fit heuristic. Put each task on the first processor with enough
space.</p>
</dd></dl>

<dl class="function">
<dt id="simso.utils.PartitionedScheduler.next_fit">
PE Hladik committed
1220
<code class="descname">next_fit</code><span class="sig-paren">(</span><em>scheduler</em>, <em>task_list=None</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.utils.PartitionedScheduler.next_fit" title="Permalink to this definition"></a></dt>
1221 1222 1223 1224 1225
<dd><p>Next-Fit heuristic. Put each task on the next processor with enough space.</p>
</dd></dl>

<dl class="function">
<dt id="simso.utils.PartitionedScheduler.worst_fit">
PE Hladik committed
1226
<code class="descname">worst_fit</code><span class="sig-paren">(</span><em>scheduler</em>, <em>task_list=None</em><span class="sig-paren">)</span><a class="headerlink" href="#simso.utils.PartitionedScheduler.worst_fit" title="Permalink to this definition"></a></dt>
1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239
<dd><p>Worst-Fit heuristic. Put the tasks somewhere it fits with the largest
spare place.</p>
</dd></dl>

</div>
</div>
</div>


          </div>
      </div>
      <div class="clearer"></div>
    </div>
PE Hladik committed
1240
    <div class="related" role="navigation" aria-label="related navigation">
1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="licenses.html" title="Licenses"
             >next</a> |</li>
        <li class="right" >
          <a href="text_mode.html" title="Using SimSo in script mode"
             >previous</a> |</li>
PE Hladik committed
1255
        <li class="nav-item nav-item-0"><a href="index.html">SimSo documentation</a> &raquo;</li> 
1256 1257
      </ul>
    </div>
PE Hladik committed
1258
    <div class="footer" role="contentinfo">
1259 1260 1261
    </div>
  </body>
</html>