The Test Vector window
The Test Vector window is similar to the Table tab of the Logging window. You can load a test vector from a file, and Logisim will start running tests on the current circuit. Like the logging window, there is only one test vector window for the project, and the table will change to reflect whichever circuit is being simulated in the project window. Note, however, that the Test Vector module runs a separate copy of the circuit simulator, and so does not interfere with, and is not influenced by, the simulation in the project window.
For the example, we will test the circuit below. This circuit gives the results of five logic functions from two inputs. It contains an error because the bottom NAND gate should be an AND gate.
The test vector file looks like this:
A B O_Nor O_Nand O_Xor O_Or O_And O_AB[2] 0 0 1 1 0 0 0 00 0 1 0 1 1 1 0 01 1 0 0 1 1 1 0 10 1 1 0 0 0 1 1 11
To run the test, select the menu | Simulate |→| Test vector | then use the Load Vector button. Select the vector file you built. The simulation is executed immediately and a table is displayed with the result.
Any incorrect outputs will be flagged in red. Hover the mouse over the red box to see what the output should have been, according to the test vector. Rows with incorrect outputs are sorted to the top of the window.
The file format is simple. You can use the Logging module (with "Include Header Line" selected in the file output tab) to get started, since in most cases the Logging module outputs the same format as used by the Test Vector module.
Interactive Test Execution
Each row in the Test Vector window has two buttons that allow you to manually interact with individual tests:
- "Show" button (first column): This button previews the circuit state without checking outputs.
- Combinational tests (seq=0): Resets the circuit, sets the input values, and propagates signals. Only the clicked row is highlighted in green to show it was executed.
- Sequential tests (seq>0): Resets the circuit, then runs all prior sequential steps in the set (from seq 1 up to the target step), propagating after each step. All executed sequential steps are highlighted in green to show the execution path.
- "Set" button (second column): This button sets input values and may execute tests.
- Combinational tests (seq=0): Resets the circuit, applies the test inputs, then propagates signals. Only the clicked row is highlighted in green to indicate it was executed.
- Sequential tests (seq>0): Does NOT reset the circuit and does NOT run any other tests. Simply sets the input values for that single step only, then propagates signals. Only the clicked row is highlighted in green. This allows you to manually step through a sequence by setting individual step values without resetting or running previous steps.
- For either button, if you turn off Auto-Propagation in the Simulation menu, it will not propagate the last step in the sequence (or the only step in the combinational test), stopping after setting the input pins. This allows you to single-step the circuit through the propagation of that line.
Highlighting behavior:
- When the Show button is clicked on a combinational test, only that single row is highlighted in green.
- When the Show button is clicked on a sequential test, all sequential steps (seq > 0) up to and including the target step are highlighted in green.
- When the Set button is clicked, only the clicked row is highlighted in green, regardless of whether it's combinational or sequential.
- Highlighting is cleared when a new vector file is loaded or when the circuit simulator is reset.
Previous: Test Vectors | Next: Test Vector File Format.