12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <html>
- <head>
- <title>Command-line verification</title>
- </head>
- <body bgcolor="FFFFFF">
- <h1>Command-line verification</h1>
- <blockquote><em>Subsections:</em>
- <br><a href="sub.html">Substituting libraries</a>
- <br><a href="other.html">Other verification options</a>
- <br><a href="multi.html">Testing multiple files</a>
- </blockquote>
- <p>Logisim includes basic support for executing circuits from the command-line.
- This is intended both to help with scripted verification of circuit designs
- and to help instructors perform automated testing of students' solutions.</p>
- <p>We'll start by seeing how to execute a circuit from the command line.
- For our example, we'll suppose we've built the below circuit in a file named <tt>adder-test.circ</tt>.
- It uses a two-bit adder as a subcircuit
- and iterates using a counter through all 16 possible inputs to it.</p>
- <blockquote><img src="../../../img-guide/verify-adder-test.png" width="217" height="131"></blockquote>
- <p>After this circuit has been built, we then execute Logisim from the command line,
- providing the filename of the project
- and the <q>-tty</q> option with the <q>table</q> parameter.</p>
- <blockquote><tt>java -jar logisim-filename.jar adder-test.circ -tty table</tt></blockquote>
- <p>Without bringing up any windows, Logisim loads the circuit and begins to execute it,
- ticking any clocks as fast as it can while completing the propagation between each tick.
- After each propagation is completed, Logisim loads the current values of the output pins;
- if any have changed from the previous propagation,
- then all values are displayed in tab-delimited format.
- If there is an output pin labeled with the special word <q>halt</q>,
- its output is not displayed — but once the pin's value reaches 1 after
- a propagation is completed, Logisim ends the simulation.</p>
- <p>For our example, Logisim displays the table below. Because we have two output
- pins corresponding to the two inputs <var>a</var> and <var>b</var> into the
- two-bit adder, these outputs are included as the first two columns of the output.
- And there is another output pin corresponding to the two-bit adder's output,
- so it is the third column.
- The columns are ordered left-to-right according to the top-down ordering within
- the circuit.</p>
- <blockquote><pre>
- 00 00 000
- 01 00 001
- 10 00 010
- 11 00 011
- 00 01 001
- 01 01 010
- 10 01 011
- 11 01 100
- 00 10 010
- 01 10 011
- 10 10 100
- 11 10 101
- 00 11 011
- 01 11 100
- 10 11 101
- 11 11 110
- </pre></blockquote>
- <p><strong>Next:</strong> <a href="sub.html">Substituting libraries</a>.</p>
- </body>
- </html>
|