@@ -24,6 +24,13 @@ Minimizing failing (or bugged) designs
24
24
.. _iverilog : https://steveicarus.github.io/iverilog/
25
25
.. _verilator : https://www.veripool.org/verilator/
26
26
27
+ - are there any warnings before the error (either immediately before or in an
28
+ earlier command) that could be related?
29
+ - does calling `check ` before the failure give any errors or warnings?
30
+ - did you call `hierarchy ` before the failure?
31
+
32
+ + can you call ``hierarchy -check ``?
33
+
27
34
- make sure to back up your code (design source and yosys script(s)) before
28
35
making any modifications
29
36
@@ -50,9 +57,15 @@ build of Yosys. Because the command works by invoking external processes, it
50
57
requires that Yosys can spawn executables. Notably this means `bugpoint ` is not
51
58
able to be used in WebAssembly builds such as that available via YoWASP. The
52
59
easiest way to check your build of Yosys is by running ``yosys -h bugpoint ``. If
53
- Yosys displays the help text for `bugpoint ` then it is available for use, but if
54
- it instead prints "No such command or cell type: bugpoint", then `bugpoint ` is
55
- not available.
60
+ Yosys displays the help text for `bugpoint ` then it is available for use.
61
+
62
+ .. code-block :: console
63
+ :caption: `bugpoint` is unavailable
64
+
65
+ $ yosys -h bugpoint
66
+
67
+ -- Running command `help bugpoint' --
68
+ No such command or cell type: bugpoint
56
69
57
70
Next you need to separate loading the design from the failure point; you should
58
71
be aiming to reproduce the failure by running ``yosys -s <load.ys> -s
@@ -87,8 +100,11 @@ making use of the `exec` command in ``<failure.ys>``. This is especially useful
87
100
when Yosys is outputting an invalid design, or when some other tool is
88
101
incompatible with the design. Be sure to use the ``exec -expect-* `` options so
89
102
that the pass/fail can be detected correctly. Multiple calls to `exec ` can be
90
- made, or even entire shell scripts (e.g. ``exec -expect-return 1 -- bash
91
- <script.sh> ``).
103
+ made, or even entire shell scripts:
104
+
105
+ .. code-block :: yoscrypt
106
+
107
+ exec -expect-return 1 --bash <script.sh>
92
108
93
109
Our final failure we can use with `bugpoint ` is one returned by a wrapper
94
110
process, such as ``valgrind `` or ``timeout ``. In this case you will be calling
@@ -98,6 +114,8 @@ leak or excessive runtime. Note however that unlike the `exec` command, there
98
114
is currently no way to check the return status or messages from the wrapper
99
115
process; only a binary pass/fail.
100
116
117
+ .. TODO :: above note pending updated bugpoint #5068
118
+
101
119
102
120
How do I use bugpoint?
103
121
~~~~~~~~~~~~~~~~~~~~~~
@@ -140,11 +158,7 @@ For more about the options available, check ``help bugpoint`` or
140
158
work with runtime errors such as a ``SEGFAULT `` as it is only able to match
141
159
strings from the log file.
142
160
143
- .. TODO :: Consider checking ``run_command`` return value for runtime errors.
144
-
145
- Currently ``BugpointPass::run_yosys `` returns ``run_command(yosys_cmdline) ==
146
- 0 ``, so it shouldn't be too hard to add an option for it. Could also be
147
- used with the ``-runner `` option, which might give it a bit more flexibility.
161
+ .. TODO :: above note pending updated bugpoint #5068
148
162
149
163
By default, `bugpoint ` is able to remove any part of the design. In order to
150
164
keep certain parts, for instance because you already know they are related to
@@ -177,6 +191,8 @@ you are using the ``-runner`` option, try replacing the `bugpoint` command with
177
191
<failure.ys> test.il `` to check it works as expected and returns a non-zero
178
192
status.
179
193
194
+ .. TODO :: note on ``!`` (link to :ref:`getting_started/scripting_intro:script parsing`)
195
+
180
196
Depending on the size of your design, and the length of your ``<failure.ys> ``,
181
197
`bugpoint ` may take some time; remember, it will run ``yosys -s <failure.ys> ``
182
198
on each iteration of the design. The bigger the design, the more iterations.
0 commit comments