Skip to content

Commit 49afc87

Browse files
committed
deploy: 3f0d19b
1 parent da5e259 commit 49afc87

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+9221
-23
lines changed

pr-10/compiler-user-guide/developing-hardware/annotations.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ <h1 id="synthesize-annotations-controlling-vhdlsystemverilog-generation"><a clas
174174
<li>Use cached versions of generated HDL, i.e., prevent recompilation of (sub)entities that have not changed since the last run.
175175
Caching is based on a <code>.manifest</code> which is generated alongside the HDL; deleting this file means deleting the cache; changing this file will result in <em>undefined</em> behavior.</li>
176176
</ul>
177-
<p>Functions with a 'Synthesize' annotation must adhere to the following restrictions:</p>
177+
<p>Functions with a <code>Synthesize</code> annotation must adhere to the following restrictions:</p>
178178
<ul>
179179
<li>Although functions with a <code>Synthesize</code> annotation can of course depend on functions with another <code>Synthesize</code> annotation, they must not be mutually recursive.</li>
180180
<li>Functions with a <code>Synthesize</code> annotation must be completely <em>monomorphic</em> and <em>first-order</em>, and cannot have any <em>non-representable</em> arguments or result.</li>

pr-10/compiler-user-guide/developing-hardware/limitations.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,17 @@ <h1 id="limitations-of-the-compiler"><a class="header" href="#limitations-of-the
305305
<p><code>Int</code> and <code>Word</code> are represented by the same number of bits as is native for the architecture of the computer on which the Clash compiler is executed.
306306
This means that if you are working on a 64-bit machine, <code>Int</code> and <code>Word</code> will be 64-bit.
307307
This might be problematic when you are working in a team, and one designer has a 32-bit machine, and the other has a 64-bit machine.
308-
In general, you should be avoiding 'Int' in such cases, but as a band-aid solution, you can force the Clash compiler to use a specific bit-width for <code>Int</code> and <code>Word</code> using the <code>-fclash-intwidth=N</code> flag, where <em>N</em> must either be <em>32</em> or <em>64</em>.</p>
308+
In general, you should be avoiding <code>Int</code> in such cases, but as a band-aid solution, you can force the Clash compiler to use a specific bit-width for <code>Int</code> and <code>Word</code> using the <code>-fclash-intwidth=N</code> flag, where <em>N</em> must either be <em>32</em> or <em>64</em>.</p>
309309
</li>
310310
<li>
311-
<p>When you use the <code>-fclash-intwidth=32</code> flag on a <em>64-bit</em> machine, the 'Word64' and 'Int64' types <em>cannot</em> be translated. This restriction does <em>not</em> apply to the other three combinations of <code>-fclash-intwidth</code> flag and machine type.</p>
311+
<p>When you use the <code>-fclash-intwidth=32</code> flag on a <em>64-bit</em> machine, the <code>Word64</code> and <code>Int64</code> types <em>cannot</em> be translated. This restriction does <em>not</em> apply to the other three combinations of <code>-fclash-intwidth</code> flag and machine type.</p>
312312
</li>
313313
<li>
314-
<p>The translation of 'Integer' is not meaning-preserving.
315-
'Integer' in Haskell is an arbitrary precision integer, something that cannot be represented in a statically known number of bits.
316-
In the Clash compiler, we chose to represent 'Integer' by the same number of bits as we do for <code>Int</code> and <code>Word</code>.
314+
<p>The translation of <code>Integer</code> is not meaning-preserving.
315+
<code>Integer</code> in Haskell is an arbitrary precision integer, something that cannot be represented in a statically known number of bits.
316+
In the Clash compiler, we chose to represent <code>Integer</code> by the same number of bits as we do for <code>Int</code> and <code>Word</code>.
317317
As you have read in a previous bullet point, this number of bits is either 32 or 64, depending on the architecture of the machine the Clash compiler is running on, or the setting of the <code>-fclash-intwidth</code> flag.</p>
318-
<p>Consequently, you should use <code>Integer</code> with due diligence; be especially careful when using <code>fromIntegral</code> as it does a conversion via 'Integer'.
318+
<p>Consequently, you should use <code>Integer</code> with due diligence; be especially careful when using <code>fromIntegral</code> as it does a conversion via <code>Integer</code>.
319319
For example:</p>
320320
<pre><code class="language-haskell">signedToUnsigned :: Signed 128 -&gt; Unsigned 128
321321
signedToUnsigned = fromIntegral

pr-10/compiler-user-guide/developing-hardware/primitives.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ <h1 class="menu-title">Clash Compiler User Guide</h1>
168168
<main>
169169
<h1 id="user-defined-primitives"><a class="header" href="#user-defined-primitives">User-defined primitives</a></h1>
170170
<p>There are times when you already have an existing piece of IP, or there are times where you need the HDL to have a specific shape so that the HDL synthesis tool can infer a specific component.
171-
In these specific cases you can resort to defining your own HDL primitives. Actually, most of the primitives in Clash are specified in the same way as you will read about in this section.
171+
In these specific cases you can resort to defining your own HDL primitives.
172+
Actually, most of the primitives in Clash are specified in the same way as you will read about in this section.
172173
There are perhaps 10 (at most) functions which are truly hard-coded into the Clash compiler.
173174
You can take a look at the files in <a href="https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/vhdl">https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/vhdl</a> (or <a href="https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/verilog">https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/verilog</a> for the Verilog primitives or <a href="https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/systemverilog">https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/systemverilog</a> for the SystemVerilog primitives) if you want to know which functions are defined as "regular" primitives.
174175
The compiler looks for primitives in four locations:</p>

pr-10/compiler-user-guide/developing-hardware/troubleshooting.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ <h1 id="troubleshooting"><a class="header" href="#troubleshooting">Troubleshooti
172172
<li>
173173
<p><strong>Type error: Couldn't match expected type <code>Signal dom (a,b)</code> with actual type <code>(Signal dom a, Signal dom b)</code></strong>:</p>
174174
<p>Signals of product types and product types of signals are <strong>isomorphic</strong> due to synchronisity principle, but are not (structurally) equal.
175-
Tuples are a product type. Use the <code>bundle</code> function to convert from a product type to the signal type.
175+
Tuples are a product type.
176+
Use the <code>bundle</code> function to convert from a product type to the signal type.
176177
So if your code which gives the error looks like:</p>
177178
<pre><code class="language-haskell">... = f a b (c,d)
178179
</code></pre>
@@ -188,7 +189,8 @@ <h1 id="troubleshooting"><a class="header" href="#troubleshooting">Troubleshooti
188189
<li>
189190
<p><strong>Type error: Couldn't match expected type <code>(Signal dom a, Signal dom b)</code> with actual type <code>Signal dom (a,b)</code></strong>:</p>
190191
<p>Product types of signals and signals of product types are <strong>isomorphic</strong> due to synchronicity principle, but are not (structurally) equal.
191-
Tuples are a product type. Use the <code>unbundle</code> function to convert from a signal type to the product type.
192+
Tuples are a product type.
193+
Use the <code>unbundle</code> function to convert from a signal type to the product type.
192194
So if your code which gives the error looks like:</p>
193195
<pre><code class="language-haskell">(c,d) = f a b
194196
</code></pre>
@@ -253,7 +255,8 @@ <h1 id="troubleshooting"><a class="header" href="#troubleshooting">Troubleshooti
253255
</li>
254256
<li>
255257
<p><strong>&lt;*** Exception: &lt;&lt;loop&gt;&gt; or "blinking cursor"</strong></p>
256-
<p>You are using value-recursion, but one of the <code>Vec</code>tor functions that you are using is too <em>strict</em> in one of the recursive arguments. For example:</p>
258+
<p>You are using value-recursion, but one of the <code>Vec</code>tor functions that you are using is too <em>strict</em> in one of the recursive arguments.
259+
For example:</p>
257260
<pre><code class="language-haskell">-- Bubble sort for 1 iteration
258261
sortV xs = map fst sorted :&lt; (snd (last sorted))
259262
where

pr-10/compiler-user-guide/print.html

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ <h2 id="undefined-values"><a class="header" href="#undefined-values">Undefined V
794794
<li>Use cached versions of generated HDL, i.e., prevent recompilation of (sub)entities that have not changed since the last run.
795795
Caching is based on a <code>.manifest</code> which is generated alongside the HDL; deleting this file means deleting the cache; changing this file will result in <em>undefined</em> behavior.</li>
796796
</ul>
797-
<p>Functions with a 'Synthesize' annotation must adhere to the following restrictions:</p>
797+
<p>Functions with a <code>Synthesize</code> annotation must adhere to the following restrictions:</p>
798798
<ul>
799799
<li>Although functions with a <code>Synthesize</code> annotation can of course depend on functions with another <code>Synthesize</code> annotation, they must not be mutually recursive.</li>
800800
<li>Functions with a <code>Synthesize</code> annotation must be completely <em>monomorphic</em> and <em>first-order</em>, and cannot have any <em>non-representable</em> arguments or result.</li>
@@ -914,7 +914,8 @@ <h2 id="undefined-values"><a class="header" href="#undefined-values">Undefined V
914914
<p>See the documentation of <code>Synthesize</code> for the meaning of all its fields.</p>
915915
<div style="break-before: page; page-break-before: always;"></div><h1 id="user-defined-primitives"><a class="header" href="#user-defined-primitives">User-defined primitives</a></h1>
916916
<p>There are times when you already have an existing piece of IP, or there are times where you need the HDL to have a specific shape so that the HDL synthesis tool can infer a specific component.
917-
In these specific cases you can resort to defining your own HDL primitives. Actually, most of the primitives in Clash are specified in the same way as you will read about in this section.
917+
In these specific cases you can resort to defining your own HDL primitives.
918+
Actually, most of the primitives in Clash are specified in the same way as you will read about in this section.
918919
There are perhaps 10 (at most) functions which are truly hard-coded into the Clash compiler.
919920
You can take a look at the files in <a href="https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/vhdl">https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/vhdl</a> (or <a href="https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/verilog">https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/verilog</a> for the Verilog primitives or <a href="https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/systemverilog">https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/systemverilog</a> for the SystemVerilog primitives) if you want to know which functions are defined as "regular" primitives.
920921
The compiler looks for primitives in four locations:</p>
@@ -1288,7 +1289,8 @@ <h2 id="systemverilog-examples"><a class="header" href="#systemverilog-examples"
12881289
<li>
12891290
<p><strong>Type error: Couldn't match expected type <code>Signal dom (a,b)</code> with actual type <code>(Signal dom a, Signal dom b)</code></strong>:</p>
12901291
<p>Signals of product types and product types of signals are <strong>isomorphic</strong> due to synchronisity principle, but are not (structurally) equal.
1291-
Tuples are a product type. Use the <code>bundle</code> function to convert from a product type to the signal type.
1292+
Tuples are a product type.
1293+
Use the <code>bundle</code> function to convert from a product type to the signal type.
12921294
So if your code which gives the error looks like:</p>
12931295
<pre><code class="language-haskell">... = f a b (c,d)
12941296
</code></pre>
@@ -1304,7 +1306,8 @@ <h2 id="systemverilog-examples"><a class="header" href="#systemverilog-examples"
13041306
<li>
13051307
<p><strong>Type error: Couldn't match expected type <code>(Signal dom a, Signal dom b)</code> with actual type <code>Signal dom (a,b)</code></strong>:</p>
13061308
<p>Product types of signals and signals of product types are <strong>isomorphic</strong> due to synchronicity principle, but are not (structurally) equal.
1307-
Tuples are a product type. Use the <code>unbundle</code> function to convert from a signal type to the product type.
1309+
Tuples are a product type.
1310+
Use the <code>unbundle</code> function to convert from a signal type to the product type.
13081311
So if your code which gives the error looks like:</p>
13091312
<pre><code class="language-haskell">(c,d) = f a b
13101313
</code></pre>
@@ -1369,7 +1372,8 @@ <h2 id="systemverilog-examples"><a class="header" href="#systemverilog-examples"
13691372
</li>
13701373
<li>
13711374
<p><strong>&lt;*** Exception: &lt;&lt;loop&gt;&gt; or "blinking cursor"</strong></p>
1372-
<p>You are using value-recursion, but one of the <code>Vec</code>tor functions that you are using is too <em>strict</em> in one of the recursive arguments. For example:</p>
1375+
<p>You are using value-recursion, but one of the <code>Vec</code>tor functions that you are using is too <em>strict</em> in one of the recursive arguments.
1376+
For example:</p>
13731377
<pre><code class="language-haskell">-- Bubble sort for 1 iteration
13741378
sortV xs = map fst sorted :&lt; (snd (last sorted))
13751379
where
@@ -1533,17 +1537,17 @@ <h2 id="systemverilog-examples"><a class="header" href="#systemverilog-examples"
15331537
<p><code>Int</code> and <code>Word</code> are represented by the same number of bits as is native for the architecture of the computer on which the Clash compiler is executed.
15341538
This means that if you are working on a 64-bit machine, <code>Int</code> and <code>Word</code> will be 64-bit.
15351539
This might be problematic when you are working in a team, and one designer has a 32-bit machine, and the other has a 64-bit machine.
1536-
In general, you should be avoiding 'Int' in such cases, but as a band-aid solution, you can force the Clash compiler to use a specific bit-width for <code>Int</code> and <code>Word</code> using the <code>-fclash-intwidth=N</code> flag, where <em>N</em> must either be <em>32</em> or <em>64</em>.</p>
1540+
In general, you should be avoiding <code>Int</code> in such cases, but as a band-aid solution, you can force the Clash compiler to use a specific bit-width for <code>Int</code> and <code>Word</code> using the <code>-fclash-intwidth=N</code> flag, where <em>N</em> must either be <em>32</em> or <em>64</em>.</p>
15371541
</li>
15381542
<li>
1539-
<p>When you use the <code>-fclash-intwidth=32</code> flag on a <em>64-bit</em> machine, the 'Word64' and 'Int64' types <em>cannot</em> be translated. This restriction does <em>not</em> apply to the other three combinations of <code>-fclash-intwidth</code> flag and machine type.</p>
1543+
<p>When you use the <code>-fclash-intwidth=32</code> flag on a <em>64-bit</em> machine, the <code>Word64</code> and <code>Int64</code> types <em>cannot</em> be translated. This restriction does <em>not</em> apply to the other three combinations of <code>-fclash-intwidth</code> flag and machine type.</p>
15401544
</li>
15411545
<li>
1542-
<p>The translation of 'Integer' is not meaning-preserving.
1543-
'Integer' in Haskell is an arbitrary precision integer, something that cannot be represented in a statically known number of bits.
1544-
In the Clash compiler, we chose to represent 'Integer' by the same number of bits as we do for <code>Int</code> and <code>Word</code>.
1546+
<p>The translation of <code>Integer</code> is not meaning-preserving.
1547+
<code>Integer</code> in Haskell is an arbitrary precision integer, something that cannot be represented in a statically known number of bits.
1548+
In the Clash compiler, we chose to represent <code>Integer</code> by the same number of bits as we do for <code>Int</code> and <code>Word</code>.
15451549
As you have read in a previous bullet point, this number of bits is either 32 or 64, depending on the architecture of the machine the Clash compiler is running on, or the setting of the <code>-fclash-intwidth</code> flag.</p>
1546-
<p>Consequently, you should use <code>Integer</code> with due diligence; be especially careful when using <code>fromIntegral</code> as it does a conversion via 'Integer'.
1550+
<p>Consequently, you should use <code>Integer</code> with due diligence; be especially careful when using <code>fromIntegral</code> as it does a conversion via <code>Integer</code>.
15471551
For example:</p>
15481552
<pre><code class="language-haskell">signedToUnsigned :: Signed 128 -&gt; Unsigned 128
15491553
signedToUnsigned = fromIntegral

pr-10/compiler-user-guide/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pr-10/tutorial/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file makes sure that Github Pages doesn't process mdBook's output.

0 commit comments

Comments
 (0)