Skip to content

Commit 09bb578

Browse files
committed
Filenames don't start with number
1 parent 2392dc4 commit 09bb578

File tree

6 files changed

+61
-61
lines changed

6 files changed

+61
-61
lines changed

01_input.md

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -184,58 +184,58 @@ python3 your_file.py gen
184184

185185
## Step 6: Run the formal verification engine for covers
186186

187-
Running your code with `gen` will have it output a file `toplevel.il`. This can be run through the SymbiYosys formal verification tool. It requires a `.sby` configuration file, which I've included in `answers/01_to_pennies.sby`.
187+
Running your code with `gen` will have it output a file `toplevel.il`. This can be run through the SymbiYosys formal verification tool. It requires a `.sby` configuration file, which I've included in `answers/e01_to_pennies.sby`.
188188

189189
```
190190
python3 your_class.py gen
191-
sby -f answers/01_to_pennies.sby cover
191+
sby -f answers/e01_to_pennies.sby cover
192192
```
193193

194194
First, look for the cover conditions to be satisfied. These are the `Reached cover statement at...` lines below. And, if all your cover statements were satisfied, you'll get a `DONE (PASS, rc=0)` line.
195195

196196
```
197-
SBY 15:17:27 [answers/01_to_pennies_cover] Removing directory 'answers/01_to_pennies_cover'.
198-
SBY 15:17:27 [answers/01_to_pennies_cover] Copy 'toplevel.il' to 'answers/01_to_pennies_cover/src/toplevel.il'.
199-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: smtbmc z3
200-
SBY 15:17:27 [answers/01_to_pennies_cover] base: starting process "cd answers/01_to_pennies_cover/src; yosys -ql ../model/design.log ../model/design.ys"
201-
SBY 15:17:27 [answers/01_to_pennies_cover] base: finished (returncode=0)
202-
SBY 15:17:27 [answers/01_to_pennies_cover] smt2: starting process "cd answers/01_to_pennies_cover/model; yosys -ql design_smt2.log design_smt2.ys"
203-
SBY 15:17:27 [answers/01_to_pennies_cover] smt2: finished (returncode=0)
204-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: starting process "cd answers/01_to_pennies_cover; yosys-smtbmc -s z3 --presat -c --noprogress -t 1 --append 0 --dump-vcd engine_0/trace%.vcd --dump-vlogtb engine_0/trace%_tb.v --dump-smtc engine_0/trace%.smtc model/design_smt2.smt2"
205-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Solver: z3
206-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Checking cover reachability in step 0..
207-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Reached cover statement at answers/to_pennies.py:45 in step 0.
208-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to VCD file: engine_0/trace0.vcd
209-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to Verilog testbench: engine_0/trace0_tb.v
210-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to constraints file: engine_0/trace0.smtc
211-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Checking cover reachability in step 0..
212-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Reached cover statement at answers/to_pennies.py:53 in step 0.
213-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to VCD file: engine_0/trace1.vcd
214-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to Verilog testbench: engine_0/trace1_tb.v
215-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to constraints file: engine_0/trace1.smtc
216-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Checking cover reachability in step 0..
217-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Reached cover statement at answers/to_pennies.py:51 in step 0.
218-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to VCD file: engine_0/trace2.vcd
219-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to Verilog testbench: engine_0/trace2_tb.v
220-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to constraints file: engine_0/trace2.smtc
221-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: ## 0:00:00 Status: passed
222-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: finished (returncode=0)
223-
SBY 15:17:27 [answers/01_to_pennies_cover] engine_0: Status returned by engine: pass
224-
SBY 15:17:27 [answers/01_to_pennies_cover] summary: Elapsed clock time [H:MM:SS (secs)]: 0:00:00 (0)
225-
SBY 15:17:27 [answers/01_to_pennies_cover] summary: Elapsed process time [H:MM:SS (secs)]: 0:00:00 (0)
226-
SBY 15:17:27 [answers/01_to_pennies_cover] summary: engine_0 (smtbmc z3) returned pass
227-
SBY 15:17:27 [answers/01_to_pennies_cover] summary: trace: answers/01_to_pennies_cover/engine_0/trace0.vcd
228-
SBY 15:17:27 [answers/01_to_pennies_cover] summary: trace: answers/01_to_pennies_cover/engine_0/trace1.vcd
229-
SBY 15:17:27 [answers/01_to_pennies_cover] summary: trace: answers/01_to_pennies_cover/engine_0/trace2.vcd
230-
SBY 15:17:27 [answers/01_to_pennies_cover] DONE (PASS, rc=0)
197+
SBY 15:17:27 [answers/e01_to_pennies_cover] Removing directory 'answers/e01_to_pennies_cover'.
198+
SBY 15:17:27 [answers/e01_to_pennies_cover] Copy 'toplevel.il' to 'answers/e01_to_pennies_cover/src/toplevel.il'.
199+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: smtbmc z3
200+
SBY 15:17:27 [answers/e01_to_pennies_cover] base: starting process "cd answers/e01_to_pennies_cover/src; yosys -ql ../model/design.log ../model/design.ys"
201+
SBY 15:17:27 [answers/e01_to_pennies_cover] base: finished (returncode=0)
202+
SBY 15:17:27 [answers/e01_to_pennies_cover] smt2: starting process "cd answers/e01_to_pennies_cover/model; yosys -ql design_smt2.log design_smt2.ys"
203+
SBY 15:17:27 [answers/e01_to_pennies_cover] smt2: finished (returncode=0)
204+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: starting process "cd answers/e01_to_pennies_cover; yosys-smtbmc -s z3 --presat -c --noprogress -t 1 --append 0 --dump-vcd engine_0/trace%.vcd --dump-vlogtb engine_0/trace%_tb.v --dump-smtc engine_0/trace%.smtc model/design_smt2.smt2"
205+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Solver: z3
206+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Checking cover reachability in step 0..
207+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Reached cover statement at answers/to_pennies.py:45 in step 0.
208+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to VCD file: engine_0/trace0.vcd
209+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to Verilog testbench: engine_0/trace0_tb.v
210+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to constraints file: engine_0/trace0.smtc
211+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Checking cover reachability in step 0..
212+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Reached cover statement at answers/to_pennies.py:53 in step 0.
213+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to VCD file: engine_0/trace1.vcd
214+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to Verilog testbench: engine_0/trace1_tb.v
215+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to constraints file: engine_0/trace1.smtc
216+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Checking cover reachability in step 0..
217+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Reached cover statement at answers/to_pennies.py:51 in step 0.
218+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to VCD file: engine_0/trace2.vcd
219+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to Verilog testbench: engine_0/trace2_tb.v
220+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Writing trace to constraints file: engine_0/trace2.smtc
221+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: ## 0:00:00 Status: passed
222+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: finished (returncode=0)
223+
SBY 15:17:27 [answers/e01_to_pennies_cover] engine_0: Status returned by engine: pass
224+
SBY 15:17:27 [answers/e01_to_pennies_cover] summary: Elapsed clock time [H:MM:SS (secs)]: 0:00:00 (0)
225+
SBY 15:17:27 [answers/e01_to_pennies_cover] summary: Elapsed process time [H:MM:SS (secs)]: 0:00:00 (0)
226+
SBY 15:17:27 [answers/e01_to_pennies_cover] summary: engine_0 (smtbmc z3) returned pass
227+
SBY 15:17:27 [answers/e01_to_pennies_cover] summary: trace: answers/e01_to_pennies_cover/engine_0/trace0.vcd
228+
SBY 15:17:27 [answers/e01_to_pennies_cover] summary: trace: answers/e01_to_pennies_cover/engine_0/trace1.vcd
229+
SBY 15:17:27 [answers/e01_to_pennies_cover] summary: trace: answers/e01_to_pennies_cover/engine_0/trace2.vcd
230+
SBY 15:17:27 [answers/e01_to_pennies_cover] DONE (PASS, rc=0)
231231
```
232232

233233
The cover statements aren't found in the order you put them in your code!
234234

235235
Each cover statement found generates a trace where you can see the inputs and outputs, as well as some intermediate signals if they are there, using `gtkwave`:
236236

237237
```
238-
gtkwave -f answers/01_to_pennies_cover/engine_0/trace0.vcd
238+
gtkwave -f answers/e01_to_pennies_cover/engine_0/trace0.vcd
239239
```
240240

241241
In this case, the first trace came from the first cover statement in the exercise. The output shows `1DD`, or 477.
@@ -245,32 +245,32 @@ In this case, the first trace came from the first cover statement in the exercis
245245
## Step 7: Run the formal verification engine for bounded model checking
246246

247247
```
248-
sby -f answers/01_to_pennies.sby bmc
248+
sby -f answers/e01_to_pennies.sby bmc
249249
```
250250

251251
"BMC" stands for Bounded Model Checking. More on this later exercises. If all assertions succeed, then you'll get a `DONE (PASS, rc=0)` line at the end. If not, you'll get a trace that you can look at.
252252

253253
```
254-
SBY 15:17:28 [answers/01_to_pennies_bmc] Removing directory 'answers/01_to_pennies_bmc'.
255-
SBY 15:17:28 [answers/01_to_pennies_bmc] Copy 'toplevel.il' to 'answers/01_to_pennies_bmc/src/toplevel.il'.
256-
SBY 15:17:28 [answers/01_to_pennies_bmc] engine_0: smtbmc z3
257-
SBY 15:17:28 [answers/01_to_pennies_bmc] base: starting process "cd answers/01_to_pennies_bmc/src; yosys -ql ../model/design.log ../model/design.ys"
258-
SBY 15:17:28 [answers/01_to_pennies_bmc] base: finished (returncode=0)
259-
SBY 15:17:28 [answers/01_to_pennies_bmc] smt2: starting process "cd answers/01_to_pennies_bmc/model; yosys -ql design_smt2.log design_smt2.ys"
260-
SBY 15:17:28 [answers/01_to_pennies_bmc] smt2: finished (returncode=0)
261-
SBY 15:17:28 [answers/01_to_pennies_bmc] engine_0: starting process "cd answers/01_to_pennies_bmc; yosys-smtbmc -s z3 --presat --noprogress -t 1 --append 0 --dump-vcd engine_0/trace.vcd --dump-vlogtb engine_0/trace_tb.v --dump-smtc engine_0/trace.smtc model/design_smt2.smt2"
262-
SBY 15:17:28 [answers/01_to_pennies_bmc] engine_0: ## 0:00:00 Solver: z3
263-
SBY 15:17:28 [answers/01_to_pennies_bmc] engine_0: ## 0:00:00 Checking assumptions in step 0..
264-
SBY 15:17:28 [answers/01_to_pennies_bmc] engine_0: ## 0:00:00 Checking assertions in step 0..
265-
SBY 15:17:41 [answers/01_to_pennies_bmc] engine_0: ## 0:00:13 Status: passed
266-
SBY 15:17:41 [answers/01_to_pennies_bmc] engine_0: finished (returncode=0)
267-
SBY 15:17:41 [answers/01_to_pennies_bmc] engine_0: Status returned by engine: pass
268-
SBY 15:17:41 [answers/01_to_pennies_bmc] summary: Elapsed clock time [H:MM:SS (secs)]: 0:00:13 (13)
269-
SBY 15:17:41 [answers/01_to_pennies_bmc] summary: Elapsed process time [H:MM:SS (secs)]: 0:00:13 (13)
270-
SBY 15:17:41 [answers/01_to_pennies_bmc] summary: engine_0 (smtbmc z3) returned pass
271-
SBY 15:17:41 [answers/01_to_pennies_bmc] DONE (PASS, rc=0)
254+
SBY 15:17:28 [answers/e01_to_pennies_bmc] Removing directory 'answers/e01_to_pennies_bmc'.
255+
SBY 15:17:28 [answers/e01_to_pennies_bmc] Copy 'toplevel.il' to 'answers/e01_to_pennies_bmc/src/toplevel.il'.
256+
SBY 15:17:28 [answers/e01_to_pennies_bmc] engine_0: smtbmc z3
257+
SBY 15:17:28 [answers/e01_to_pennies_bmc] base: starting process "cd answers/e01_to_pennies_bmc/src; yosys -ql ../model/design.log ../model/design.ys"
258+
SBY 15:17:28 [answers/e01_to_pennies_bmc] base: finished (returncode=0)
259+
SBY 15:17:28 [answers/e01_to_pennies_bmc] smt2: starting process "cd answers/e01_to_pennies_bmc/model; yosys -ql design_smt2.log design_smt2.ys"
260+
SBY 15:17:28 [answers/e01_to_pennies_bmc] smt2: finished (returncode=0)
261+
SBY 15:17:28 [answers/e01_to_pennies_bmc] engine_0: starting process "cd answers/e01_to_pennies_bmc; yosys-smtbmc -s z3 --presat --noprogress -t 1 --append 0 --dump-vcd engine_0/trace.vcd --dump-vlogtb engine_0/trace_tb.v --dump-smtc engine_0/trace.smtc model/design_smt2.smt2"
262+
SBY 15:17:28 [answers/e01_to_pennies_bmc] engine_0: ## 0:00:00 Solver: z3
263+
SBY 15:17:28 [answers/e01_to_pennies_bmc] engine_0: ## 0:00:00 Checking assumptions in step 0..
264+
SBY 15:17:28 [answers/e01_to_pennies_bmc] engine_0: ## 0:00:00 Checking assertions in step 0..
265+
SBY 15:17:41 [answers/e01_to_pennies_bmc] engine_0: ## 0:00:13 Status: passed
266+
SBY 15:17:41 [answers/e01_to_pennies_bmc] engine_0: finished (returncode=0)
267+
SBY 15:17:41 [answers/e01_to_pennies_bmc] engine_0: Status returned by engine: pass
268+
SBY 15:17:41 [answers/e01_to_pennies_bmc] summary: Elapsed clock time [H:MM:SS (secs)]: 0:00:13 (13)
269+
SBY 15:17:41 [answers/e01_to_pennies_bmc] summary: Elapsed process time [H:MM:SS (secs)]: 0:00:13 (13)
270+
SBY 15:17:41 [answers/e01_to_pennies_bmc] summary: engine_0 (smtbmc z3) returned pass
271+
SBY 15:17:41 [answers/e01_to_pennies_bmc] DONE (PASS, rc=0)
272272
```
273273

274274
## Stumped?
275275

276-
The answer to this exercise is in [`answers/01_to_pennies.py`](answers/01_to_pennies.py).
276+
The answer to this exercise is in [`answers/e01_to_pennies.py`](answers/e01_to_pennies.py).

02_switch.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ As before, you will need to:
107107
* Write the logic for the module in `elaborate`.
108108
* Write your asserts in `formal`.
109109
* Make sure it compiles with `python3 your_file.py gen`.
110-
* Run formal verification in cover mode using `sby -f answers/02_next_day.sby cover`.
111-
* Run formal verification in BMC mode using `sby -f answers/02_next_day.sby bmc`.
110+
* Run formal verification in cover mode using `sby -f answers/e02_next_day.sby cover`.
111+
* Run formal verification in BMC mode using `sby -f answers/e02_next_day.sby bmc`.
112112

113-
If you want, you can run all formal verification modes by leaving off the mode: `sby -f answers/02_next_day.sby`. This actually runs all the things specified in the `[tasks]` section in the sby file.
113+
If you want, you can run all formal verification modes by leaving off the mode: `sby -f answers/e02_next_day.sby`. This actually runs all the things specified in the `[tasks]` section in the sby file.
114114

115115
## Stumped?
116116

117-
The answer to this exercise is in [`answers/02_next_day.py`](answers/02_next_day.py).
117+
The answer to this exercise is in [`answers/e02_next_day.py`](answers/e02_next_day.py).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)