Skip to content

Commit c942a4c

Browse files
committed
Address reviewer comments
1 parent ab4c2fe commit c942a4c

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

compiler-user-guide/src/developing-hardware/annotations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Use cached versions of generated HDL, i.e., prevent recompilation of (sub)entities that have not changed since the last run.
88
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.
99

10-
Functions with a 'Synthesize' annotation must adhere to the following restrictions:
10+
Functions with a `Synthesize` annotation must adhere to the following restrictions:
1111

1212
* Although functions with a `Synthesize` annotation can of course depend on functions with another `Synthesize` annotation, they must not be mutually recursive.
1313
* Functions with a `Synthesize` annotation must be completely *monomorphic* and *first-order*, and cannot have any *non-representable* arguments or result.

compiler-user-guide/src/developing-hardware/limitations.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,16 @@ Here is a list of Haskell features for which the Clash compiler has only _limite
160160
* `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.
161161
This means that if you are working on a 64-bit machine, `Int` and `Word` will be 64-bit.
162162
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_.
164164

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.
166166

167-
* The translation of 'Integer' is not meaning-preserving.
168-
'Integer' in Haskell 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` in Haskell 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`.
170170
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 `-fclash-intwidth` flag.
171171

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`.
173173
For example:
174174

175175
``` haskell

compiler-user-guide/src/developing-hardware/primitives.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# User-defined primitives
22
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.
45
There are perhaps 10 (at most) functions which are truly hard-coded into the Clash compiler.
56
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.
67
The compiler looks for primitives in four locations:

compiler-user-guide/src/developing-hardware/troubleshooting.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ A list of often encountered errors and their solutions:
55
* __Type error: Couldn't match expected type `Signal dom (a,b)` with actual type `(Signal dom a, Signal dom b)`__:
66

77
Signals of product types and product types of signals are __isomorphic__ due to synchronisity principle, but are not (structurally) equal.
8-
Tuples are a product type. Use the `bundle` function to convert from a product type to the signal type.
8+
Tuples are a product type.
9+
Use the `bundle` function to convert from a product type to the signal type.
910
So if your code which gives the error looks like:
1011

1112
``` haskell
@@ -26,7 +27,8 @@ A list of often encountered errors and their solutions:
2627
* __Type error: Couldn't match expected type `(Signal dom a, Signal dom b)` with actual type `Signal dom (a,b)`__:
2728

2829
Product types of signals and signals of product types are __isomorphic__ due to synchronicity principle, but are not (structurally) equal.
29-
Tuples are a product type. Use the `unbundle` function to convert from a signal type to the product type.
30+
Tuples are a product type.
31+
Use the `unbundle` function to convert from a signal type to the product type.
3032
So if your code which gives the error looks like:
3133

3234
``` haskell
@@ -96,7 +98,8 @@ A list of often encountered errors and their solutions:
9698

9799
* __<*** Exception: <\<loop\>> or "blinking cursor"__
98100

99-
You are using value-recursion, but one of the `Vec`tor functions that you are using is too *strict* in one of the recursive arguments. For example:
101+
You are using value-recursion, but one of the `Vec`tor functions that you are using is too *strict* in one of the recursive arguments.
102+
For example:
100103

101104
``` haskell
102105
-- Bubble sort for 1 iteration

0 commit comments

Comments
 (0)