Skip to content

Commit 01f9e77

Browse files
Copyedit
1 parent 53ee3b2 commit 01f9e77

File tree

8 files changed

+101
-104
lines changed

8 files changed

+101
-104
lines changed

compiler-user-guide/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ title = "Clash Compiler User Guide"
88
build-dir = "../public/compiler-user-guide"
99

1010
[output.html]
11-
site-url = "/compiler-user-guide/"
11+
site-url = "/compiler-user-guide/"

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

Lines changed: 50 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# Clash Compiler Flags
22

3-
--vhdl
3+
`--vhdl`
44
Use the VHDL backend for code generation.
55
This currently emits VHDL 1993 source which can be consumed by other tools.
66

7-
--verilog
7+
`--verilog`
88
Use the Verilog backend for code generation.
99
This currently emits Verilog 2001 source which can be consumed by other tools.
1010

11-
--systemverilog
11+
`--systemverilog`
1212
Use the SystemVerilog backend for code generation.
1313
This currently emits SystemVerilog 2012 source which can be consumed by other tools.
1414

15-
-fclash-debug
15+
`-fclash-debug`
1616
Set the debugging mode for the compiler, exposing additional output.
1717
The available options are
1818

1919
- `DebugNone` to show no debug messages
2020
- `DebugSilent` to test invariants and error if any are violated.
21-
This is implicitly enabled by any debug flag
21+
This is implicitly enabled by any debug flag.
2222
- `DebugFinal` to show expressions after they have been completely normalized
2323
- `DebugCount` to count how often each transformation is applied
2424
- `DebugName` to show the names of transformations as they are applied
@@ -38,69 +38,64 @@ Note
3838

3939
This flag exists for backwards compatibility.
4040
It is now possible to set debugging flags individually with
41-
<span class="title-ref">-fclash-debug-invariants</span>,
42-
<span class="title-ref">-fclash-debug-info</span> and
43-
<span class="title-ref">-fclash-debug-count-transformations</span>.
41+
<span class="title-ref">`-fclash-debug-invariants`</span>,
42+
<span class="title-ref">`-fclash-debug-info`</span> and
43+
<span class="title-ref">`-fclash-debug-count-transformations`</span>.
4444

4545
</div>
4646

47-
-fclash-debug-invariants
48-
Check invariants while debugging and print warnings / errors which may be useful, such as alterting when unexpected changes occur or when a transformation introduces free variables / shadowing.
47+
`-fclash-debug-invariants`
48+
Check invariants while debugging and print warnings/errors which may be useful, such as alerting when unexpected changes occur or when a transformation introduces free variables / shadowing.
4949

50-
-fclash-debug-info
50+
`-fclash-debug-info`
5151
Specify the information to show about individual transformations while debugging.
5252
From least to most information, these are
5353

5454
- `None` to show no information
55-
5655
- `FinalTerm` to show the final result of normalization
57-
5856
- `AppliedName` to show the names of applied transformations
59-
6057
- `AppliedTerm` to show the result of applied transformations
61-
62-
- `TryName` to show the names of attempted transforamtions, as well as the result of any transformations which are applied
63-
58+
- `TryName` to show the names of attempted transformations, as well as the result of any transformations which are applied
6459
- `TryTerm` to show the names and results of all transformations attempted whether they were applied or not
6560

66-
**Default:** `None`
61+
**Default:** `None`
6762

68-
-fclash-debug-count-transformations
63+
`-fclash-debug-count-transformations`
6964
Count the transformations that are applied and print a summary at the end of the normalization phase.
7065

71-
-fclash-debug-history\[=FILENAME\]
66+
`-fclash-debug-history[=FILENAME]`
7267
Saves all applied rewrites into `FILENAME`, for later analysis with the clash-term tool.
7368
When no filename is given it defaults to `history.dat`.
7469

75-
-fclash-debug-transformations
70+
`-fclash-debug-transformations`
7671
List the transformations that are to be debugged.
7772
This is given as a comma-separated list of transformations, e.g.
7873

7974
``` bash
8075
clash -fclash-debug-transformations inlineNonRep,topLet,appProp
8176
```
8277

83-
**Default:** \[\]
78+
**Default:** `[]`
8479

85-
-fclash-debug-transformations-from=N
80+
`-fclash-debug-transformations-from=N`
8681
Only print debug output from applied transformation `N` and onwards.
8782

8883
``` bash
8984
clash -fclash-debug-transformations-from=21570
9085
```
9186

92-
**Default:** 0
87+
**Default:** `0`
9388

94-
-fclash-debug-transformations-limit=N
89+
`-fclash-debug-transformations-limit=N`
9590
Only print debug output for `N` applied transformations.
9691

9792
``` bash
9893
clash -fclash-debug-transformations-limit=12
9994
```
10095

101-
**Default:** MAX_INT
96+
**Default:** `MAX_INT`
10297

103-
-fclash-hdldir
98+
`-fclash-hdldir`
10499
Specify the directory that generated HDL is written into.
105100
For example
106101

@@ -112,13 +107,13 @@ will create a directory `build/hdl`
112107

113108
**Default:** Either `vhdl`, `verilog`, or `systemverilog` depending on the synthesis target.
114109

115-
-fclash-hdlsyn
110+
`-fclash-hdlsyn`
116111
Specify the HDL synthesis tool which will be used.
117-
Available options are `Vivado`, `Quartus` and `Other`, but some synonyms for these exist (`Xilinx` and `ISE` are synonyms for `Vivado`, `Altera` and `Intel` are synyonyms for `Quartus`).
112+
Available options are `Vivado`, `Quartus` and `Other`, but some synonyms for these exist (`Xilinx` and `ISE` are synonyms for `Vivado`, `Altera` and `Intel` are synonyms for `Quartus`).
118113

119114
**Default:** `Other`
120115

121-
-fclash-no-cache
116+
`-fclash-no-cache`
122117
Don't reuse previously generated output from Clash, instead generating HDL from a clean state.
123118
While this leads to longer builds, it can be useful in development.
124119

@@ -136,20 +131,20 @@ Previously this flag was called `-fclash-nocache`, however this is now deprecate
136131

137132
**Default:** Cache generated HDL
138133

139-
-fclash-no-check-inaccessible-idirs
134+
`-fclash-no-check-inaccessible-idirs`
140135
Check that all include directories (containing primitives) exist when running Clash.
141136
If any directory does not exist, an error is thrown.
142137

143138
**Default:** Check directories
144139

145-
-fclash-clear
140+
`-fclash-clear`
146141
Remove HDL directories before writing to them (if cache can't be used).
147142
By default, Clash will only write to non-empty directories if it can prove all files in it are generated by a previous run.
148143
This option applies to directories of the various top entities, i.e., the subdirectories made in the directory passed in with `-fclash-hdldir`.
149144

150145
**Default:** Clean before build
151146

152-
-fclash-no-prim-warn
147+
`-fclash-no-prim-warn`
153148
Disable warnings for primitives that are annotated with `warnAlways`.
154149
This means warnings from annotations like
155150

@@ -161,56 +156,56 @@ will not be shown when compiling.
161156

162157
**Default:** Show warnings
163158

164-
-fclash-spec-limit
159+
`-fclash-spec-limit`
165160
Change the number of times a function can undergo specialization.
166161

167162
**Default:** 20
168163

169-
-fclash-inline-limit
164+
`-fclash-inline-limit`
170165
Change the number of times a function `f` can undergo inlining inside some other function `g`.
171166
This prevents the size of `g` growing dramatically.
172167

173168
**Default:** 20
174169

175-
-fclash-inline-function-limit
170+
`-fclash-inline-function-limit`
176171
Set the threshold for function size.
177-
Below this threshold functions are always inlined (if it is not recursive).
172+
Below this threshold a function is always inlined (if it is not recursive).
178173

179174
**Default:** 15
180175

181-
-fclash-inline-constant-limit
176+
`-fclash-inline-constant-limit`
182177
Set the threshold for constant size.
183178
Below this threshold constants are always inlined.
184179
A value of 0 inlines all constants.
185180

186181
**Default:** 0
187182

188-
-fclash-evaluator-fuel-limit
183+
`-fclash-evaluator-fuel-limit`
189184
Set the threshold for unfolding potentially non-terminating bindings in the evaluator.
190185
A value of 0 only unfolds terminating bindings.
191186

192187
**Default:** 20
193188

194-
-fclash-intwidth
189+
`-fclash-intwidth`
195190
Set the bit width for the `Int/Word/Integer` types in the generated HDL.
196191
Clash simulation is not affected, and neither are `BitPack` instances.
197192
The only allowed values are 32 or 64.
198193

199194
**Default:** Machine word size (`WORD_SIZE_IN_BITS`)
200195

201-
-fclash-error-extra
196+
`-fclash-error-extra`
202197
Print additional information with compiler errors if it as available.
203198
If there is extra information and this flag is not enabled, a message will be printed suggesting this flag.
204199

205200
**Default:** False
206201

207-
-fclash-float-support
202+
`-fclash-float-support`
208203
Enable support for floating point numbers.
209204
If this is disabled, Clash will not attempt to convert Float and Double values for hardware.
210205

211206
**Default:** False
212207

213-
-fclash-component-prefix
208+
`-fclash-component-prefix`
214209
Prefix the names of generated HDl components with a string.
215210
For example a component `foo` would be called `xcorp_foo` if run with
216211

@@ -220,37 +215,37 @@ clash -fclash-component-prefix "xcorp"
220215

221216
**Default:** ""
222217

223-
-fclash-old-inline-strategy
218+
`-fclash-old-inline-strategy`
224219
The new inlining strategy for Clash inlines all functions which are not marked with `NOINLINE` or a synthesize attribute.
225220
The old inlining strategy differed, attempting only to inline functions which were deemed "cheap".
226221
The old inlining strategy may be quicker in practice for some circuits.
227222

228223
**Default:** False
229224

230-
-fclash-no-escaped-identifiers
225+
`-fclash-no-escaped-identifiers`
231226
Disable extended identifiers, as used in some HDLs like VHDL to allow more flexibility with names.
232227
Clash will only generate basic identifiers if this is used.
233228

234229
**Default:** Escaped identifiers are allowed
235230

236-
-fclash-lower-case-basic-identifiers
231+
`-fclash-lower-case-basic-identifiers`
237232
Clash will only generate lower case basic identifiers if this is used.
238233
This affects places where the various HDLs only allow basic identifiers to be used, most notably module and file names.
239234

240235
**Default:** Disabled
241236

242-
-fclash-compile-ultra
237+
`-fclash-compile-ultra`
243238
Aggressively run the normalizer, potentially gaining much better runtime performance at the expense of compile time.
244239

245240
**Default:** False
246241

247-
-fclash-force-undefined{,0,1}
242+
`-fclash-force-undefined{,0,1}`
248243
Set the value to use when an undefined value is inserted into generated HDL.
249244
This flag can be suffixed with either 0 or 1 to force use of that bit, or left without a suffix to use a HDL-specific default (e.g. `x` in Verilog).
250245

251246
**Default:** Disabled
252247

253-
-fclash-aggressive-x-optimization
248+
`-fclash-aggressive-x-optimization`
254249
Remove all undefined branches from case expressions, replacing them with another defined value in the expression.
255250
If only one branch is defined, the case expression is elided completely.
256251
If no branches are defined the entire expression is replaced with a call to `errorX`.
@@ -259,25 +254,25 @@ If no branches are defined the entire expression is replaced with a call to `err
259254

260255
**Default:** False
261256

262-
-fclash-aggressive-x-optimization-blackboxes
257+
`-fclash-aggressive-x-optimization-blackboxes`
263258
Allow blackboxes to detect undefined values and change their behavior accordingly.
264259
For example, if `register` is used in combination with an undefined reset value, it will leave out the reset logic entirely.
265260
This flag is enabled when using `-fclash-aggressive-x-optimization`.
266261

267262
**Default:** False
268263

269-
-fclash-edalize
264+
`-fclash-edalize`
270265
Generate metadata for use with [Edalize](https://github.com/olofk/edalize).
271266
This generates edam.py files in all top entities with the configuration for building that entity.
272-
Users still need to edit this file to specify the EDA tool to use, and if necessary the device to target (for Quartus, Vivado etc.)
267+
Users still need to edit this file to specify the EDA tool to use, and if necessary the device to target (for Quartus, Vivado etc.).
273268

274269
**Default:** False
275270

276-
-main-is
277-
When using one of `--vhdl`, `--verilog`, or `--systemverilog`, this flag refers to synthesis target.
271+
`-main-is`
272+
When using one of `--vhdl`, `--verilog`, or `--systemverilog`, this flag refers to the synthesis target.
278273
For example, running Clash with `clash My.Module -main-is top --vhdl` would synthesize `My.Module.top`.
279274

280-
-fclash-timescale-precision
275+
`-fclash-timescale-precision`
281276
Sets the second part of Verilog's `timescale 100fs/100fs`.
282277
E.g., setting this flag to `1fs` would make Clash generate Verilog files with `timescale 100fs/1fs` as their header.
283278

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Clash as a Language
22

3-
As Clash reuses parts of the GHC compiler for its front-end, the syntax and semantics should be familiar to Haskell programmers.
3+
As Clash reuses parts of the GHC compiler for its frontend, the syntax and semantics should be familiar to Haskell programmers.
44
For people unfamiliar with Haskell, there are many resources to learn the language, such as
55

66
- [Learn You a Haskell](http://learnyouahaskell.com/chapters)

0 commit comments

Comments
 (0)