]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_GCC/freedom-metal/doc/html/devguide/itim.html
Base project to replace existing Freedom Studio project using latest Freedom Studio...
[freertos] / FreeRTOS / Demo / RISC-V_RV32_SiFive_HiFive1_GCC / freedom-metal / doc / html / devguide / itim.html
1
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml">
6   <head>
7     <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
8     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9     <title>Instruction Tightly Integrated Memory &#8212; Freedom Metal v201905 documentation</title>
10     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
11     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
12     <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
13     <script type="text/javascript" src="../_static/jquery.js"></script>
14     <script type="text/javascript" src="../_static/underscore.js"></script>
15     <script type="text/javascript" src="../_static/doctools.js"></script>
16     <link rel="index" title="Index" href="../genindex.html" />
17     <link rel="search" title="Search" href="../search.html" />
18     <link rel="next" title="Physical Memory Protection" href="pmps.html" />
19     <link rel="prev" title="Interrupt Handlers" href="interrupts.html" />
20    
21   <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
22   
23   
24   <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
25
26   </head><body>
27   
28
29     <div class="document">
30       <div class="documentwrapper">
31         <div class="bodywrapper">
32           
33
34           <div class="body" role="main">
35             
36   <div class="section" id="instruction-tightly-integrated-memory">
37 <h1>Instruction Tightly Integrated Memory<a class="headerlink" href="#instruction-tightly-integrated-memory" title="Permalink to this headline">¶</a></h1>
38 <p>The Instruction Tightly Integrated Memory (ITIM) is an optional feature
39 on certain SiFive RISC-V CPUs. The ITIM is a memory device which is
40 optimized in the CoreIP memory heirarchy to provide low-latency
41 access to instruction memory.</p>
42 <p>Freedom Metal provides the ability to designate functions to run out of
43 the ITIM by decorating the functions with the following “decorator”:</p>
44 <dl class="macro">
45 <dt id="c.METAL_PLACE_IN_ITIM">
46 <span class="target" id="itim_8h_1adc7154309c0e245ae246c435665eebb6"></span><code class="descname">METAL_PLACE_IN_ITIM</code><a class="headerlink" href="#c.METAL_PLACE_IN_ITIM" title="Permalink to this definition">¶</a></dt>
47 <dd><p>Link a function into the ITIM. </p>
48 <p>Link a function into the ITIM (Instruction Tightly Integrated Memory) if the ITIM is present on the target device. </p>
49 </dd></dl>
50
51 <p>For example:</p>
52 <div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="n">METAL_PLACE_IN_ITIM</span>
53 <span class="kt">void</span> <span class="nf">my_itim_func</span><span class="p">()</span> <span class="p">{</span>
54    <span class="cm">/* This code will run out of the ITIM */</span>
55 <span class="p">}</span>
56 </pre></div>
57 </div>
58 <div class="section" id="caveats">
59 <h2>Caveats<a class="headerlink" href="#caveats" title="Permalink to this headline">¶</a></h2>
60 <p>The <code class="docutils literal notranslate"><span class="pre">METAL_PLACE_IN_ITIM</span></code> decorator tells the toolchain to link the
61 decorated function into the ITIM memory. However, compiler optimizations
62 such as function inlining may cause execution to never transfer to
63 instructions fetched from the ITIM.</p>
64 <p>If this compiler optimization is not desired, one workaround is to
65 tell the compiler to not inline the function:</p>
66 <div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="n">__attribute__</span><span class="p">((</span><span class="n">noinline</span><span class="p">))</span>
67 <span class="n">METAL_PLACE_IN_ITIM</span>
68 <span class="kt">void</span> <span class="n">my_itim_func</span><span class="p">()</span> <span class="p">{</span>
69    <span class="cm">/* This code will run out of the ITIM */</span>
70 <span class="p">}</span>
71 </pre></div>
72 </div>
73 </div>
74 </div>
75
76
77           </div>
78           
79         </div>
80       </div>
81       <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
82         <div class="sphinxsidebarwrapper">
83 <h1 class="logo"><a href="../index.html">Freedom Metal</a></h1>
84
85
86
87
88
89
90
91
92 <h3>Navigation</h3>
93 <ul class="current">
94 <li class="toctree-l1"><a class="reference internal" href="../introduction.html">Introduction to Freedom Metal</a></li>
95 <li class="toctree-l1 current"><a class="reference internal" href="../devguide.html">Developer Guide</a><ul class="current">
96 <li class="toctree-l2"><a class="reference internal" href="exceptions.html">Exception Handlers</a></li>
97 <li class="toctree-l2"><a class="reference internal" href="fe310-g000-pll.html">FE310-G00 PLL</a></li>
98 <li class="toctree-l2"><a class="reference internal" href="interrupts.html">Interrupt Handlers</a></li>
99 <li class="toctree-l2 current"><a class="current reference internal" href="#">Instruction Tightly Integrated Memory</a></li>
100 <li class="toctree-l2"><a class="reference internal" href="pmps.html">Physical Memory Protection</a></li>
101 <li class="toctree-l2"><a class="reference internal" href="tty.html">Standard I/O</a></li>
102 </ul>
103 </li>
104 <li class="toctree-l1"><a class="reference internal" href="../api.html">API Reference</a></li>
105 </ul>
106
107 <div class="relations">
108 <h3>Related Topics</h3>
109 <ul>
110   <li><a href="../index.html">Documentation overview</a><ul>
111   <li><a href="../devguide.html">Developer Guide</a><ul>
112       <li>Previous: <a href="interrupts.html" title="previous chapter">Interrupt Handlers</a></li>
113       <li>Next: <a href="pmps.html" title="next chapter">Physical Memory Protection</a></li>
114   </ul></li>
115   </ul></li>
116 </ul>
117 </div>
118 <div id="searchbox" style="display: none" role="search">
119   <h3>Quick search</h3>
120     <div class="searchformwrapper">
121     <form class="search" action="../search.html" method="get">
122       <input type="text" name="q" />
123       <input type="submit" value="Go" />
124       <input type="hidden" name="check_keywords" value="yes" />
125       <input type="hidden" name="area" value="default" />
126     </form>
127     </div>
128 </div>
129 <script type="text/javascript">$('#searchbox').show(0);</script>
130         </div>
131       </div>
132       <div class="clearer"></div>
133     </div>
134     <div class="footer">
135       &copy;2019, SiFive Inc..
136       
137       |
138       Powered by <a href="http://sphinx-doc.org/">Sphinx 1.7.5</a>
139       &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.11</a>
140       
141       |
142       <a href="../_sources/devguide/itim.rst.txt"
143           rel="nofollow">Page source</a>
144     </div>
145
146     
147
148     
149   </body>
150 </html>