Skip to content

Commit

Permalink
Deploying to gh-pages from @ 485f6b3 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Oct 31, 2024
1 parent af8d7ca commit a850cd0
Show file tree
Hide file tree
Showing 2,062 changed files with 44,224 additions and 42,540 deletions.
2 changes: 1 addition & 1 deletion dev/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 3e80880ca8a0a009995afd61e34ffdbc
config: 26101f30f32034a54b7b82094a7274bf
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified dev/.doctrees/SpinalHDL/About SpinalHDL/faq.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/About SpinalHDL/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/About SpinalHDL/support.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/About SpinalHDL/users.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Data types/AFix.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Data types/Fix.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Data types/Floating.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Data types/Int.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Data types/Vec.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Data types/bits.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Data types/bool.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Data types/bundle.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Data types/enum.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Data types/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Design errors/assignment_overlap.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Design errors/combinatorial_loop.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Design errors/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Design errors/iobundle.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Design errors/latch_detected.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Design errors/no_driver_on.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Design errors/scope_violation.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Design errors/spinal_cant_clone.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Design errors/width_mismatch.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Developers area/howtodocument.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Developers area/index.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Developers area/types.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/Advanced ones/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/Advanced ones/jtag.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/Advanced ones/pinesec.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/Advanced ones/timer.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/Intermediates ones/uart.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/Intermediates ones/vga.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/Simple ones/apb3.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/Simple ones/carry_adder.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/Simple ones/index.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/Simple ones/rgb_to_gray.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/Simple ones/sinus_rom.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Examples/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Formal verification/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Getting Started/Cheatsheets/core.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Getting Started/Cheatsheets/lib.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Getting Started/getting_started.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Getting Started/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Getting Started/motivation.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Getting Started/presentation.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Legacy/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Legacy/pinsec/hardware.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Legacy/pinsec/hardware_toplevel.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Legacy/pinsec/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Legacy/pinsec/introduction.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Legacy/pinsec/software.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Legacy/riscv.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Bus/amba3/ahblite3.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Bus/amba3/apb3.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Bus/amba4/axi4.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Bus/avalon/avalonmm.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Bus/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Com/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Com/uart.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Com/usb_device.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Com/usb_ohci.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/EDA/altera/qsysify.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/EDA/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Graphics/colors.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Graphics/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Graphics/vga.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/IO/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/IO/readableOpenDrain.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/IO/tristate.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Misc/PLIC/plic_mapper.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/Misc/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/binarySystem.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/bus_slave_factory.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/fiber.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/flow.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/fragment.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/fsm.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/regIf.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/stream.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/utils.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Libraries/vexriscv.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Other language features/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Other language features/report.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Other language features/stub.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Other language features/utils.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Semantic/assignments.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Semantic/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Semantic/rules.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Semantic/when_switch.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Sequential logic/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Sequential logic/memory.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Sequential logic/registers.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/bootstraps.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/clock.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/engine.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/examples/asynchronous.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/examples/index.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/examples/synchronous.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/examples/uart_decoder.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/examples/uart_encoder.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/install/GHDL.doctree
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/install/VCS.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/install/Verilator.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/install/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/sensitive.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/signal.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/threadFull.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Simulation/threadLess.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Structuring/area.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Structuring/blackbox.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Structuring/clock_domain.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Structuring/components_hierarchy.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Structuring/function.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Structuring/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Structuring/naming.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/Structuring/parametrization.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/miscelenea/chisel.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/miscelenea/core/core_components.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/miscelenea/core/elements.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/miscelenea/frequent_errors.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/miscelenea/index.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/miscelenea/lib/briey/hardware.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/miscelenea/lib/briey/software.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/miscelenea/regular_hdl.doctree
Binary file not shown.
Binary file modified dev/.doctrees/SpinalHDL/miscelenea/things_to_do.doctree
Binary file not shown.
Binary file modified dev/.doctrees/environment.pickle
Binary file not shown.
Binary file modified dev/.doctrees/index.doctree
Binary file not shown.
6 changes: 3 additions & 3 deletions dev/SpinalHDL/About SpinalHDL/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -1198,9 +1198,9 @@ <h2>Why develop a new language when there is VHDL/Verilog/SystemVerilog?<a class
<section id="how-to-use-an-unreleased-version-of-spinalhdl-but-committed-on-git">
<h2>How to use an unreleased version of SpinalHDL (but committed on git)?<a class="headerlink" href="#how-to-use-an-unreleased-version-of-spinalhdl-but-committed-on-git" title="Permalink to this heading"></a></h2>
<p>For instance, if you want to try the <code class="docutils literal notranslate"><span class="pre">dev</span></code> branch, do the following in a dummy folder :</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/SpinalHDL/SpinalHDL.git<span class="w"> </span>-b<span class="w"> </span>dev
<span class="nb">cd</span><span class="w"> </span>SpinalHDL
sbt<span class="w"> </span>clean<span class="w"> </span>publishLocal
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>git clone https://github.com/SpinalHDL/SpinalHDL.git -b dev
<span class="nb">cd</span> SpinalHDL
sbt clean publishLocal
</pre></div>
</div>
<div class="line-block">
Expand Down
62 changes: 31 additions & 31 deletions dev/SpinalHDL/Data types/AFix.html
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ <h2>Declaration<a class="headerlink" href="#declaration" title="Permalink to thi
<p><code class="docutils literal notranslate"><span class="pre">AFix.SQ(8</span> <span class="pre">bits,</span> <span class="pre">4</span> <span class="pre">bits)</span></code> will have a range of -4096 (-256) to 4095 (255.9375)</p>
<p><code class="docutils literal notranslate"><span class="pre">AFix.U(8</span> <span class="pre">exp,</span> <span class="pre">4</span> <span class="pre">exp)</span></code> will have a range of 0 to 256</p>
<p>Custom range <code class="docutils literal notranslate"><span class="pre">AFix</span></code> values can be created be directly instantiating the class.</p>
<div class="highlight-scala notranslate"><div class="highlight"><pre><span></span><span class="k">class</span><span class="w"> </span><span class="nc">AFix</span><span class="p">(</span><span class="kd">val</span><span class="w"> </span><span class="n">maxValue</span><span class="p">:</span><span class="w"> </span><span class="nc">BigInt</span><span class="p">,</span><span class="w"> </span><span class="kd">val</span><span class="w"> </span><span class="n">minValue</span><span class="p">:</span><span class="w"> </span><span class="nc">BigInt</span><span class="p">,</span><span class="w"> </span><span class="kd">val</span><span class="w"> </span><span class="n">exp</span><span class="p">:</span><span class="w"> </span><span class="nc">ExpNumber</span><span class="p">)</span>
<div class="highlight-scala notranslate"><div class="highlight"><pre><span></span><span class="k">class</span><span class="w"> </span><span class="nc">AFix</span><span class="p">(</span><span class="kd">val</span><span class="w"> </span><span class="n">maxValue</span><span class="p">:</span><span class="w"> </span><span class="nc">BigInt</span><span class="p">,</span><span class="w"> </span><span class="kd">val</span><span class="w"> </span><span class="n">minValue</span><span class="p">:</span><span class="w"> </span><span class="nc">BigInt</span><span class="p">,</span><span class="w"> </span><span class="kd">val</span><span class="w"> </span><span class="n">exp</span><span class="p">:</span><span class="w"> </span><span class="nc">ExpNumber</span><span class="p">)</span><span class="w"></span>

<span class="k">new</span><span class="w"> </span><span class="nc">AFix</span><span class="p">(</span><span class="mi">4096</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="n">exp</span><span class="p">)</span><span class="w"> </span><span class="c1">// [0 to 4096, 2^0]</span>
<span class="k">new</span><span class="w"> </span><span class="nc">AFix</span><span class="p">(</span><span class="mi">256</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mi">256</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mi">2</span><span class="w"> </span><span class="n">exp</span><span class="p">)</span><span class="w"> </span><span class="c1">// [-256 to 256, 2^-2]</span>
Expand Down Expand Up @@ -1241,12 +1241,12 @@ <h2>Mathematical Operations<a class="headerlink" href="#mathematical-operations"
<section id="inequality-operations">
<h2>Inequality Operations<a class="headerlink" href="#inequality-operations" title="Permalink to this heading"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">AFix</span></code> supports standard inequality operations.</p>
<div class="highlight-scala notranslate"><div class="highlight"><pre><span></span><span class="nc">A</span><span class="w"> </span><span class="o">===</span><span class="w"> </span><span class="nc">B</span>
<span class="nc">A</span><span class="w"> </span><span class="o">=\=</span><span class="w"> </span><span class="nc">B</span>
<span class="nc">A</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="nc">B</span>
<span class="nc">A</span><span class="w"> </span><span class="o">&lt;=</span><span class="w"> </span><span class="nc">B</span>
<span class="nc">A</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="nc">B</span>
<span class="nc">A</span><span class="w"> </span><span class="o">&gt;=</span><span class="w"> </span><span class="nc">B</span>
<div class="highlight-scala notranslate"><div class="highlight"><pre><span></span><span class="nc">A</span><span class="w"> </span><span class="o">===</span><span class="w"> </span><span class="nc">B</span><span class="w"></span>
<span class="nc">A</span><span class="w"> </span><span class="o">=\=</span><span class="w"> </span><span class="nc">B</span><span class="w"></span>
<span class="nc">A</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="nc">B</span><span class="w"></span>
<span class="nc">A</span><span class="w"> </span><span class="o">&lt;=</span><span class="w"> </span><span class="nc">B</span><span class="w"></span>
<span class="nc">A</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="nc">B</span><span class="w"></span>
<span class="nc">A</span><span class="w"> </span><span class="o">&gt;=</span><span class="w"> </span><span class="nc">B</span><span class="w"></span>
</pre></div>
</div>
<p>Warning: Operations which are out of range at compile time will be optimized out!</p>
Expand All @@ -1272,17 +1272,17 @@ <h2>Saturation and Rounding<a class="headerlink" href="#saturation-and-rounding"
</div>
<p><code class="docutils literal notranslate"><span class="pre">AFix</span></code> rounding modes:</p>
<div class="highlight-scala notranslate"><div class="highlight"><pre><span></span><span class="c1">// The following require exp &lt; 0</span>
<span class="p">.</span><span class="n">floor</span><span class="p">()</span><span class="w"> </span><span class="n">or</span><span class="w"> </span><span class="p">.</span><span class="n">truncate</span><span class="p">()</span>
<span class="p">.</span><span class="n">ceil</span><span class="p">()</span>
<span class="p">.</span><span class="n">floorToZero</span><span class="p">()</span>
<span class="p">.</span><span class="n">ceilToInf</span><span class="p">()</span>
<span class="p">.</span><span class="n">floor</span><span class="p">()</span><span class="w"> </span><span class="n">or</span><span class="w"> </span><span class="p">.</span><span class="n">truncate</span><span class="p">()</span><span class="w"></span>
<span class="p">.</span><span class="n">ceil</span><span class="p">()</span><span class="w"></span>
<span class="p">.</span><span class="n">floorToZero</span><span class="p">()</span><span class="w"></span>
<span class="p">.</span><span class="n">ceilToInf</span><span class="p">()</span><span class="w"></span>
<span class="c1">// The following require exp &lt; -1</span>
<span class="p">.</span><span class="n">roundHalfUp</span><span class="p">()</span>
<span class="p">.</span><span class="n">roundHalfDown</span><span class="p">()</span>
<span class="p">.</span><span class="n">roundHalfToZero</span><span class="p">()</span>
<span class="p">.</span><span class="n">roundHalfToInf</span><span class="p">()</span>
<span class="p">.</span><span class="n">roundHalfToEven</span><span class="p">()</span>
<span class="p">.</span><span class="n">roundHalfToOdd</span><span class="p">()</span>
<span class="p">.</span><span class="n">roundHalfUp</span><span class="p">()</span><span class="w"></span>
<span class="p">.</span><span class="n">roundHalfDown</span><span class="p">()</span><span class="w"></span>
<span class="p">.</span><span class="n">roundHalfToZero</span><span class="p">()</span><span class="w"></span>
<span class="p">.</span><span class="n">roundHalfToInf</span><span class="p">()</span><span class="w"></span>
<span class="p">.</span><span class="n">roundHalfToEven</span><span class="p">()</span><span class="w"></span>
<span class="p">.</span><span class="n">roundHalfToOdd</span><span class="p">()</span><span class="w"></span>
</pre></div>
</div>
<p>An mathematical example of these rounding modes is better explained here: <a class="reference external" href="https://en.wikipedia.org/wiki/Rounding">Rounding - Wikipedia</a></p>
Expand All @@ -1294,24 +1294,24 @@ <h2>Assignment<a class="headerlink" href="#assignment" title="Permalink to this
<p><code class="docutils literal notranslate"><span class="pre">AFix</span></code> will automatically check and expand range and precision during assignment. By default, it is an error to assign
an <code class="docutils literal notranslate"><span class="pre">AFix</span></code> value to another <code class="docutils literal notranslate"><span class="pre">AFix</span></code> value with smaller range or precision.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">.truncated</span></code> function is used to control how assignments to smaller types.</p>
<div class="highlight-scala notranslate"><div class="highlight"><pre><span></span><span class="k">def</span><span class="w"> </span><span class="nf">truncated</span><span class="p">(</span><span class="n">saturation</span><span class="p">:</span><span class="w"> </span><span class="nc">Boolean</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span>
<span class="w"> </span><span class="n">overflow</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="nc">Boolean</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="n">rounding</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="nc">RoundType</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">RoundType</span><span class="p">.</span><span class="nc">FLOOR</span><span class="p">)</span>
<div class="highlight-scala notranslate"><div class="highlight"><pre><span></span><span class="k">def</span><span class="w"> </span><span class="nf">truncated</span><span class="p">(</span><span class="n">saturation</span><span class="p">:</span><span class="w"> </span><span class="nc">Boolean</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">overflow</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="nc">Boolean</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">rounding</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="nc">RoundType</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">RoundType</span><span class="p">.</span><span class="nc">FLOOR</span><span class="p">)</span><span class="w"></span>

<span class="k">def</span><span class="w"> </span><span class="nf">saturated</span><span class="p">():</span><span class="w"> </span><span class="nc">AFix</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">this</span><span class="p">.</span><span class="n">truncated</span><span class="p">(</span><span class="n">saturation</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w"> </span><span class="n">overflow</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">false</span><span class="p">)</span>
<span class="k">def</span><span class="w"> </span><span class="nf">saturated</span><span class="p">():</span><span class="w"> </span><span class="nc">AFix</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">this</span><span class="p">.</span><span class="n">truncated</span><span class="p">(</span><span class="n">saturation</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w"> </span><span class="n">overflow</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">false</span><span class="p">)</span><span class="w"></span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">RoundType</span></code>:</p>
<div class="highlight-scala notranslate"><div class="highlight"><pre><span></span><span class="nc">RoundType</span><span class="p">.</span><span class="nc">FLOOR</span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">CEIL</span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">FLOORTOZERO</span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">CEILTOINF</span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDUP</span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDDOWN</span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDTOZERO</span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDTOINF</span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDTOEVEN</span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDTOODD</span>
<div class="highlight-scala notranslate"><div class="highlight"><pre><span></span><span class="nc">RoundType</span><span class="p">.</span><span class="nc">FLOOR</span><span class="w"></span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">CEIL</span><span class="w"></span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">FLOORTOZERO</span><span class="w"></span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">CEILTOINF</span><span class="w"></span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDUP</span><span class="w"></span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDDOWN</span><span class="w"></span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDTOZERO</span><span class="w"></span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDTOINF</span><span class="w"></span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDTOEVEN</span><span class="w"></span>
<span class="nc">RoundType</span><span class="p">.</span><span class="nc">ROUNDTOODD</span><span class="w"></span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">saturation</span></code> flag will add logic to saturate to the assigned datatype range.</p>
Expand Down
Loading

0 comments on commit a850cd0

Please sign in to comment.