Окно тестовых векторов
Окно тестовых векторов похоже на вкладку "Таблица" окна журналирования. Вы можете загрузить тестовый вектор из файла, и Logisim начнёт запускать тесты на текущей схеме. Как и окно журналирования, для проекта существует только одно окно тестовых векторов, и таблица будет меняться в зависимости от того, какая схема симулируется в окне проекта. Однако обратите внимание, что модуль тестовых векторов запускает отдельную копию симулятора схем, поэтому он не мешает и не зависит от симуляции в окне проекта.
В качестве примера мы протестируем схему ниже. Эта схема выдаёт результаты пяти логических функций из двух входов. Она содержит ошибку, потому что нижний элемент NAND должен быть элементом AND.
Файл тестового вектора выглядит так:
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
Чтобы запустить тест, выберите меню | Симуляция |→| Тестовый вектор |, затем используйте кнопку Загрузить вектор. Выберите созданный вами файл вектора. Симуляция выполняется немедленно, и отображается таблица с результатом.
Любые неверные выходы будут отмечены красным цветом. Наведите курсор мыши на красное поле, чтобы увидеть, каким должен был быть выход согласно тестовому вектору. Строки с неверными выходами сортируются в начало окна.
Формат файла простой. Вы можете использовать модуль журналирования (с выбранной опцией "Включить строку заголовка" во вкладке вывода файла) для начала работы, поскольку в большинстве случаев модуль журналирования выводит тот же формат, что используется модулем тестовых векторов.
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.
Предыдущий: Тестовые векторы | Следующий: Формат файла тестовых векторов.