Skip to content

Commit 14d3f39

Browse files
Reformat to single sentence per line
Only source file whitespace changes, the generated site is exactly the same before and after (actual bug-for-bug compatiblity, including what is obviously a formatting error X-D. I'll take care of it in another PR.) `wdiff` was used to verify the generated files were identical save white space.
1 parent fe2dc85 commit 14d3f39

File tree

8 files changed

+300
-529
lines changed

8 files changed

+300
-529
lines changed
Lines changed: 72 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
# Clash Compiler Flags
22

33
--vhdl
4-
Use the VHDL backend for code generation. This currently emits VHDL 1993
5-
source which can be consumed by other tools.
4+
Use the VHDL backend for code generation.
5+
This currently emits VHDL 1993 source which can be consumed by other tools.
66

77
--verilog
8-
Use the Verilog backend for code generation. This currently emits
9-
Verilog 2001 source which can be consumed by other tools.
8+
Use the Verilog backend for code generation.
9+
This currently emits Verilog 2001 source which can be consumed by other tools.
1010

1111
--systemverilog
12-
Use the SystemVerilog backend for code generation. This currently emits
13-
SystemVerilog 2012 source which can be consumed by other tools.
12+
Use the SystemVerilog backend for code generation.
13+
This currently emits SystemVerilog 2012 source which can be consumed by other tools.
1414

1515
-fclash-debug
16-
Set the debugging mode for the compiler, exposing additional output. The
17-
available options are
16+
Set the debugging mode for the compiler, exposing additional output.
17+
The available options are
1818

1919
- `DebugNone` to show no debug messages
20-
- `DebugSilent` to test invariants and error if any are violated. This
21-
is implicitly enabled by any debug flag
22-
- `DebugFinal` to show expressions after they have been completely
23-
normalized
20+
- `DebugSilent` to test invariants and error if any are violated.
21+
This is implicitly enabled by any debug flag
22+
- `DebugFinal` to show expressions after they have been completely normalized
2423
- `DebugCount` to count how often each transformation is applied
2524
- `DebugName` to show the names of transformations as they are applied
2625
- `DebugTry` to show names of tried and applied transformations
@@ -37,22 +36,20 @@ Note
3736

3837
</div>
3938

40-
This flag exists for backwards compatibility. It is now possible to set
41-
debugging flags individually with
39+
This flag exists for backwards compatibility.
40+
It is now possible to set debugging flags individually with
4241
<span class="title-ref">-fclash-debug-invariants</span>,
4342
<span class="title-ref">-fclash-debug-info</span> and
4443
<span class="title-ref">-fclash-debug-count-transformations</span>.
4544

4645
</div>
4746

4847
-fclash-debug-invariants
49-
Check invariants while debugging and print warnings / errors which may
50-
be useful, such as alterting when unexpected changes occur or when a
51-
transformation introduces free variables / shadowing.
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.
5249

5350
-fclash-debug-info
54-
Specify the information to show about individual transformations while
55-
debugging. From least to most information, these are
51+
Specify the information to show about individual transformations while debugging.
52+
From least to most information, these are
5653

5754
- `None` to show no information
5855

@@ -62,25 +59,22 @@ debugging. From least to most information, these are
6259

6360
- `AppliedTerm` to show the result of applied transformations
6461

65-
- `TryName` to show the names of attempted transforamtions, as well as
66-
the result of any transformations which are applied
62+
- `TryName` to show the names of attempted transforamtions, as well as the result of any transformations which are applied
6763

68-
- `TryTerm` to show the names and results of all transformations
69-
attempted whether they were applied or not
64+
- `TryTerm` to show the names and results of all transformations attempted whether they were applied or not
7065

7166
**Default:** `None`
7267

7368
-fclash-debug-count-transformations
74-
Count the transformations that are applied and print a summary at the
75-
end of the normalization phase.
69+
Count the transformations that are applied and print a summary at the end of the normalization phase.
7670

7771
-fclash-debug-history\[=FILENAME\]
78-
Saves all applied rewrites into `FILENAME`, for later analysis with the
79-
clash-term tool. When no filename is given it defaults to `history.dat`.
72+
Saves all applied rewrites into `FILENAME`, for later analysis with the clash-term tool.
73+
When no filename is given it defaults to `history.dat`.
8074

8175
-fclash-debug-transformations
82-
List the transformations that are to be debugged. This is given as a
83-
comma-separated list of transformations, e.g.
76+
List the transformations that are to be debugged.
77+
This is given as a comma-separated list of transformations, e.g.
8478

8579
``` bash
8680
clash -fclash-debug-transformations inlineNonRep,topLet,appProp
@@ -107,29 +101,26 @@ clash -fclash-debug-transformations-limit=12
107101
**Default:** MAX_INT
108102

109103
-fclash-hdldir
110-
Specify the directory that generated HDL is written into. For example
104+
Specify the directory that generated HDL is written into.
105+
For example
111106

112107
``` bash
113108
clash -fclash-hdldir build/hdl
114109
```
115110

116111
will create a directory `build/hdl`
117112

118-
**Default:** Either `vhdl`, `verilog`, or `systemverilog` depending on
119-
the synthesis target.
113+
**Default:** Either `vhdl`, `verilog`, or `systemverilog` depending on the synthesis target.
120114

121115
-fclash-hdlsyn
122-
Specify the HDL synthesis tool which will be used. Available options are
123-
`Vivado`, `Quartus` and `Other`, but some synonyms for these exist
124-
(`Xilinx` and `ISE` are synonyms for `Vivado`, `Altera` and `Intel` are
125-
synyonyms for `Quartus`).
116+
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`).
126118

127119
**Default:** `Other`
128120

129121
-fclash-no-cache
130-
Don't reuse previously generated output from Clash, instead generating
131-
HDL from a clean state. While this leads to longer builds, it can be
132-
useful in development.
122+
Don't reuse previously generated output from Clash, instead generating HDL from a clean state.
123+
While this leads to longer builds, it can be useful in development.
133124

134125
<div class="warning">
135126

@@ -139,25 +130,22 @@ Warning
139130

140131
</div>
141132

142-
Previously this flag was called `-fclash-nocache`, however this is now
143-
deprecated.
133+
Previously this flag was called `-fclash-nocache`, however this is now deprecated.
144134

145135
</div>
146136

147137
**Default:** Cache generated HDL
148138

149139
-fclash-no-check-inaccessible-idirs
150-
Check that all include directories (containing primitives) exist when
151-
running Clash. If any directory does not exist, an error is thrown.
140+
Check that all include directories (containing primitives) exist when running Clash.
141+
If any directory does not exist, an error is thrown.
152142

153143
**Default:** Check directories
154144

155145
-fclash-clear
156146
Remove HDL directories before writing to them (if cache can't be used).
157-
By default, Clash will only write to non-empty directories if it can
158-
prove all files in it are generated by a previous run. This option
159-
applies to directories of the various top entities, i.e., the
160-
subdirectories made in the directory passed in with `-fclash-hdldir`.
147+
By default, Clash will only write to non-empty directories if it can prove all files in it are generated by a previous run.
148+
This option applies to directories of the various top entities, i.e., the subdirectories made in the directory passed in with `-fclash-hdldir`.
161149

162150
**Default:** Clean before build
163151

@@ -179,27 +167,27 @@ Change the number of times a function can undergo specialization.
179167
**Default:** 20
180168

181169
-fclash-inline-limit
182-
Change the number of times a function `f` can undergo inlining inside
183-
some other function `g`. This prevents the size of `g` growing
184-
dramatically.
170+
Change the number of times a function `f` can undergo inlining inside some other function `g`.
171+
This prevents the size of `g` growing dramatically.
185172

186173
**Default:** 20
187174

188175
-fclash-inline-function-limit
189-
Set the threshold for function size. Below this threshold functions are
190-
always inlined (if it is not recursive).
176+
Set the threshold for function size.
177+
Below this threshold functions are always inlined (if it is not recursive).
191178

192179
**Default:** 15
193180

194181
-fclash-inline-constant-limit
195-
Set the threshold for constant size. Below this threshold constants are
196-
always inlined. A value of 0 inlines all constants.
182+
Set the threshold for constant size.
183+
Below this threshold constants are always inlined.
184+
A value of 0 inlines all constants.
197185

198186
**Default:** 0
199187

200188
-fclash-evaluator-fuel-limit
201-
Set the threshold for unfolding potentially non-terminating bindings in
202-
the evaluator. A value of 0 only unfolds terminating bindings.
189+
Set the threshold for unfolding potentially non-terminating bindings in the evaluator.
190+
A value of 0 only unfolds terminating bindings.
203191

204192
**Default:** 20
205193

@@ -211,21 +199,20 @@ The only allowed values are 32 or 64.
211199
**Default:** Machine word size (`WORD_SIZE_IN_BITS`)
212200

213201
-fclash-error-extra
214-
Print additional information with compiler errors if it as available. If
215-
there is extra information and this flag is not enabled, a message will
216-
be printed suggesting this flag.
202+
Print additional information with compiler errors if it as available.
203+
If there is extra information and this flag is not enabled, a message will be printed suggesting this flag.
217204

218205
**Default:** False
219206

220207
-fclash-float-support
221-
Enable support for floating point numbers. If this is disabled, Clash
222-
will not attempt to convert Float and Double values for hardware.
208+
Enable support for floating point numbers.
209+
If this is disabled, Clash will not attempt to convert Float and Double values for hardware.
223210

224211
**Default:** False
225212

226213
-fclash-component-prefix
227-
Prefix the names of generated HDl components with a string. For example
228-
a component `foo` would be called `xcorp_foo` if run with
214+
Prefix the names of generated HDl components with a string.
215+
For example a component `foo` would be called `xcorp_foo` if run with
229216

230217
``` bash
231218
clash -fclash-component-prefix "xcorp"
@@ -234,77 +221,64 @@ clash -fclash-component-prefix "xcorp"
234221
**Default:** ""
235222

236223
-fclash-old-inline-strategy
237-
The new inlining strategy for Clash inlines all functions which are not
238-
marked with `NOINLINE` or a synthesize attribute. The old inlining
239-
strategy differed, attempting only to inline functions which were deemed
240-
"cheap". The old inlining strategy may be quicker in practice for some
241-
circuits.
224+
The new inlining strategy for Clash inlines all functions which are not marked with `NOINLINE` or a synthesize attribute.
225+
The old inlining strategy differed, attempting only to inline functions which were deemed "cheap".
226+
The old inlining strategy may be quicker in practice for some circuits.
242227

243228
**Default:** False
244229

245230
-fclash-no-escaped-identifiers
246-
Disable extended identifiers, as used in some HDLs like VHDL to allow
247-
more flexibility with names. Clash will only generate basic identifiers
248-
if this is used.
231+
Disable extended identifiers, as used in some HDLs like VHDL to allow more flexibility with names.
232+
Clash will only generate basic identifiers if this is used.
249233

250234
**Default:** Escaped identifiers are allowed
251235

252236
-fclash-lower-case-basic-identifiers
253237
Clash will only generate lower case basic identifiers if this is used.
254-
This affects places where the various HDLs only allow basic identifiers
255-
to be used, most notably module and file names.
238+
This affects places where the various HDLs only allow basic identifiers to be used, most notably module and file names.
256239

257240
**Default:** Disabled
258241

259242
-fclash-compile-ultra
260-
Aggressively run the normalizer, potentially gaining much better runtime
261-
performance at the expense of compile time.
243+
Aggressively run the normalizer, potentially gaining much better runtime performance at the expense of compile time.
262244

263245
**Default:** False
264246

265247
-fclash-force-undefined{,0,1}
266-
Set the value to use when an undefined value is inserted into generated
267-
HDL. This flag can be suffixed with either 0 or 1 to force use of that
268-
bit, or left without a suffix to use a HDL-specific default (e.g. `x` in
269-
Verilog).
248+
Set the value to use when an undefined value is inserted into generated HDL.
249+
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).
270250

271251
**Default:** Disabled
272252

273253
-fclash-aggressive-x-optimization
274-
Remove all undefined branches from case expressions, replacing them with
275-
another defined value in the expression. If only one branch is defined,
276-
the case expression is elided completely. If no branches are defined the
277-
entire expression is replaced with a call to `errorX`.
254+
Remove all undefined branches from case expressions, replacing them with another defined value in the expression.
255+
If only one branch is defined, the case expression is elided completely.
256+
If no branches are defined the entire expression is replaced with a call to `errorX`.
278257

279258
**Implies:** `-fclash-aggressive-x-optimization-blackboxes`
280259

281260
**Default:** False
282261

283262
-fclash-aggressive-x-optimization-blackboxes
284-
Allow blackboxes to detect undefined values and change their behavior
285-
accordingly. For example, if `register` is used in combination with an
286-
undefined reset value, it will leave out the reset logic entirely. This
287-
flag is enabled when using `-fclash-aggressive-x-optimization`.
263+
Allow blackboxes to detect undefined values and change their behavior accordingly.
264+
For example, if `register` is used in combination with an undefined reset value, it will leave out the reset logic entirely.
265+
This flag is enabled when using `-fclash-aggressive-x-optimization`.
288266

289267
**Default:** False
290268

291269
-fclash-edalize
292-
Generate metadata for use with
293-
[Edalize](https://github.com/olofk/edalize). This generates edam.py
294-
files in all top entities with the configuration for building that
295-
entity. Users still need to edit this file to specify the EDA tool to
296-
use, and if necessary the device to target (for Quartus, Vivado etc.)
270+
Generate metadata for use with [Edalize](https://github.com/olofk/edalize).
271+
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.)
297273

298274
**Default:** False
299275

300276
-main-is
301-
When using one of `--vhdl`, `--verilog`, or `--systemverilog`, this flag
302-
refers to synthesis target. For example, running Clash with
303-
`clash My.Module -main-is top --vhdl` would synthesize `My.Module.top`.
277+
When using one of `--vhdl`, `--verilog`, or `--systemverilog`, this flag refers to synthesis target.
278+
For example, running Clash with `clash My.Module -main-is top --vhdl` would synthesize `My.Module.top`.
304279

305280
-fclash-timescale-precision
306-
Sets the second part of Verilog's `timescale 100fs/100fs`. E.g., setting
307-
this flag to `1fs` would make Clash generate Verilog files with
308-
`timescale 100fs/1fs` as their header.
281+
Sets the second part of Verilog's `timescale 100fs/100fs`.
282+
E.g., setting this flag to `1fs` would make Clash generate Verilog files with `timescale 100fs/1fs` as their header.
309283

310284
**Default:** `100fs`

compiler-userguide/src/developing-hardware/language.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
# Clash as a Language
22

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

86
- [Learn You a Haskell](http://learnyouahaskell.com/chapters)
97
- [Real World Haskell](http://book.realworldhaskell.org/read/)
108
- [The Haskell Wikibook](https://en.wikibooks.org/wiki/Haskell)
119

12-
Clash does make some use of more advanced features of GHC Haskell, which
13-
are exposed by GHC as language extensions. The extensions used by Clash
14-
are
10+
Clash does make some use of more advanced features of GHC Haskell, which are exposed by GHC as language extensions.
11+
The extensions used by Clash are
1512

1613
- [BinaryLiterals](https://downloads.haskell.org/~ghc/9.0.1/docs/html/users_guide/exts/binary_literals.html)
1714
- [ConstraintKinds](https://downloads.haskell.org/~ghc/9.0.1/docs/html/users_guide/exts/constraint_kind.html)
@@ -48,20 +45,17 @@ Warning
4845

4946
</div>
5047

51-
Since GHC 8.6, the `StarIsType` extension is defined. This extension is
52-
explicitly turned off by Clash, meaning `Data.Kind.Type` must be used to
53-
refer to Haskell types.
48+
Since GHC 8.6, the `StarIsType` extension is defined.
49+
This extension is explicitly turned off by Clash, meaning `Data.Kind.Type` must be used to refer to Haskell types.
5450

5551
</div>
5652

57-
Clash also enables some GHC plugins by default which improve the type
58-
inference for type level numbers. The plugins enabled by default are
53+
Clash also enables some GHC plugins by default which improve the type inference for type level numbers.
54+
The plugins enabled by default are
5955

6056
- [ghc-typelits-extra](https://hackage.haskell.org/package/ghc-typelits-extra)
6157
- [ghc-typelits-knownnat](https://hackage.haskell.org/package/ghc-typelits-knownnat)
6258
- [ghc-typelits-natnormalise](https://hackage.haskell.org/package/ghc-typelits-natnormalise)
6359

64-
Users are free to control the language extensions and GHC options with
65-
the normal `OPTIONS_GHC` and `LANGUAGE` pragmas in source files. For
66-
more information, see the [GHC User's
67-
Guide](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/).
60+
Users are free to control the language extensions and GHC options with the normal `OPTIONS_GHC` and `LANGUAGE` pragmas in source files.
61+
For more information, see the [GHC User's Guide](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/).

0 commit comments

Comments
 (0)