index.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <html>
  2. <head>
  3. <title>Command-line verification</title>
  4. </head>
  5. <body bgcolor="FFFFFF">
  6. <h1>Command-line verification</h1>
  7. <blockquote><em>Subsections:</em>
  8. <br><a href="sub.html">Substituting libraries</a>
  9. <br><a href="other.html">Other verification options</a>
  10. <br><a href="multi.html">Testing multiple files</a>
  11. </blockquote>
  12. <p>Logisim includes basic support for executing circuits from the command-line.
  13. This is intended both to help with scripted verification of circuit designs
  14. and to help instructors perform automated testing of students' solutions.</p>
  15. <p>We'll start by seeing how to execute a circuit from the command line.
  16. For our example, we'll suppose we've built the below circuit in a file named <tt>adder-test.circ</tt>.
  17. It uses a two-bit adder as a subcircuit
  18. and iterates using a counter through all 16 possible inputs to it.</p>
  19. <blockquote><img src="../../../img-guide/verify-adder-test.png" width="217" height="131"></blockquote>
  20. <p>After this circuit has been built, we then execute Logisim from the command line,
  21. providing the filename of the project
  22. and the <q>-tty</q> option with the <q>table</q> parameter.</p>
  23. <blockquote><tt>java -jar logisim-filename.jar adder-test.circ -tty table</tt></blockquote>
  24. <p>Without bringing up any windows, Logisim loads the circuit and begins to execute it,
  25. ticking any clocks as fast as it can while completing the propagation between each tick.
  26. After each propagation is completed, Logisim loads the current values of the output pins;
  27. if any have changed from the previous propagation,
  28. then all values are displayed in tab-delimited format.
  29. If there is an output pin labeled with the special word <q>halt</q>,
  30. its output is not displayed &mdash; but once the pin's value reaches 1 after
  31. a propagation is completed, Logisim ends the simulation.</p>
  32. <p>For our example, Logisim displays the table below. Because we have two output
  33. pins corresponding to the two inputs <var>a</var> and <var>b</var> into the
  34. two-bit adder, these outputs are included as the first two columns of the output.
  35. And there is another output pin corresponding to the two-bit adder's output,
  36. so it is the third column.
  37. The columns are ordered left-to-right according to the top-down ordering within
  38. the circuit.</p>
  39. <blockquote><pre>
  40. 00 00 000
  41. 01 00 001
  42. 10 00 010
  43. 11 00 011
  44. 00 01 001
  45. 01 01 010
  46. 10 01 011
  47. 11 01 100
  48. 00 10 010
  49. 01 10 011
  50. 10 10 100
  51. 11 10 101
  52. 00 11 011
  53. 01 11 100
  54. 10 11 101
  55. 11 11 110
  56. </pre></blockquote>
  57. <p><strong>Next:</strong> <a href="sub.html">Substituting libraries</a>.</p>
  58. </body>
  59. </html>