You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler-user-guide/src/developing-hardware/annotations.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
* Use cached versions of generated HDL, i.e., prevent recompilation of (sub)entities that have not changed since the last run.
8
8
Caching is based on a `.manifest` which is generated alongside the HDL; deleting this file means deleting the cache; changing this file will result in *undefined* behavior.
9
9
10
-
Functions with a 'Synthesize' annotation must adhere to the following restrictions:
10
+
Functions with a `Synthesize` annotation must adhere to the following restrictions:
11
11
12
12
* Although functions with a `Synthesize` annotation can of course depend on functions with another `Synthesize` annotation, they must not be mutually recursive.
13
13
* Functions with a `Synthesize` annotation must be completely *monomorphic* and *first-order*, and cannot have any *non-representable* arguments or result.
Copy file name to clipboardExpand all lines: compiler-user-guide/src/developing-hardware/limitations.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,16 +160,16 @@ Here is a list of Haskell features for which the Clash compiler has only _limite
160
160
* `Int` and `Word` are represented by the same number of bits as is native for the architecture of the computer on which the Clash compiler is executed.
161
161
This means that if you are working on a 64-bit machine, `Int` and `Word` will be 64-bit.
162
162
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.
163
-
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 `Int` and `Word` using the `-fclash-intwidth=N` flag, where _N_ must either be _32_ or _64_.
163
+
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 `Int` and `Word` using the `-fclash-intwidth=N` flag, where _N_ must either be _32_ or _64_.
164
164
165
-
*When you use the `-fclash-intwidth=32` flag on a _64-bit_ machine, the 'Word64'and'Int64' types _cannot_ be translated.This restriction does _not_ apply to the other three combinations of `-fclash-intwidth` flag and machine type.
165
+
*When you use the `-fclash-intwidth=32` flag on a _64-bit_ machine, the `Word64`and`Int64` types _cannot_ be translated.This restriction does _not_ apply to the other three combinations of `-fclash-intwidth` flag and machine type.
166
166
167
-
*The translation of'Integer' is not meaning-preserving.
168
-
'Integer'inHaskell is an arbitrary precision integer, something that cannot be represented in a statically known number of bits.
169
-
In the Clash compiler, we chose to represent 'Integer' by the same number of bits as we do for `Int` and `Word`.
167
+
*The translation of`Integer` is not meaning-preserving.
168
+
`Integer`inHaskell is an arbitrary precision integer, something that cannot be represented in a statically known number of bits.
169
+
In the Clash compiler, we chose to represent `Integer` by the same number of bits as we do for `Int` and `Word`.
170
170
As you have readin a previous bullet point, this number of bits is either32or64, depending on the architecture of the machine the Clash compiler is running on, or the setting of the `-fclash-intwidth` flag.
171
171
172
-
Consequently, you should use `Integer` with due diligence; be especially careful when using `fromIntegral` as it does a conversion via 'Integer'.
172
+
Consequently, you should use `Integer` with due diligence; be especially careful when using `fromIntegral` as it does a conversion via `Integer`.
Copy file name to clipboardExpand all lines: compiler-user-guide/src/developing-hardware/primitives.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# User-defined primitives
2
2
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.
3
-
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.
3
+
In these specific cases you can resort to defining your own HDL primitives.
4
+
Actually, most of the primitives in Clash are specified in the same way as you will read about in this section.
4
5
There are perhaps 10 (at most) functions which are truly hard-coded into the Clash compiler.
5
6
You can take a look at the files in <https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/vhdl> (or <https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/verilog> for the Verilog primitives or <https://github.com/clash-lang/clash-compiler/tree/master/clash-lib/prims/systemverilog> for the SystemVerilog primitives) if you want to know which functions are defined as "regular" primitives.
6
7
The compiler looks for primitives in four locations:
0 commit comments