Testes Sequenciais

A funcionalidade de Vetor de Teste suporta tanto testes de circuitos combinacionais quanto sequenciais. Por padrão, os testes são combinacionais: o circuito é reiniciado antes de cada teste, garantindo que cada teste seja independente.

Para circuitos sequenciais, você pode especificar sequências de teste usando as colunas especiais de cabeçalho <set> e <seq>:

Aqui está um exemplo de um vetor de teste sequencial:

# Teste sequencial para um contador
Clock Reset Count <set> <seq>
0     0     0     1     1
1     0     0     1     2
0     0     1     1     3
1     0     1     1     4
0     0     2     1     5
1     0     2     1     6
0     1     0     2     1

Neste exemplo, os primeiros seis testes têm <set> 1 com valores <seq> 1-6, então eles formam uma sequência que é executada em ordem (seq 1, depois 2, depois 3, etc.) sem reiniciar entre etapas. O último teste tem <set> 2, então ele inicia uma nova sequência e o circuito é reiniciado antes de ser executado.

Note also that Clock could be an input pin here. But it could also be a labeled clock component (see below).

Regras de Execução de Sequência

Using the Clock

In a sequential test, the first step begins with a reset. In every step after the first, it begins with a simulation tick. Any Clock components in the simulation will be updated by that tick and their signals will be propagated along with any input pin values for that step. You may add a column to the test to show the ticks. The column will be checked against the clock in the circuit as if it were an output pin to verify it describes the clocks behavior. Here is an example for a simple positive edge-triggered D flip-flop test with a standard clock:

<clk> D Q NotQ  <set> <seq>
  0   0 0   1     1     1
  1   0 0   1     1     2
  0   1 0   1     1     3
  1   1 1   0     1     4
  0   1 1   0     1     5
  1   1 1   0     1     6
  0   0 1   0     1     7

The <clk> header is a special name for an unlabeled clock component. You may also label the clock and use the label as the column header (see earlier example).

We recommend that when using a Clock, you should not change the values of memory inputs during the same step that the clock makes a triggering transition. Doing so may allow an input signal to reach the component at near the same time as the clock signal giving surprising behavior. In the example above, the D input does not change in steps with a rising edge of the clock.

Exemplo Completo

Aqui está um exemplo completo combinando todas as funcionalidades:

# Mixed combinational and sequential tests
A B C Out     <clk> <set> <seq>
0 0 0 0       0     0     0
0 0 1 1       0     0     0
1 1 0 1       0     1     1
0 1 0 0       1     1     2
1 1 1 1       0     1     3
0 0 0 <DC>    0     2     1
1 0 1 <float> 1     2     2

In this example:

Thus the execution might look like this:

  1. Reset, set A=0, B=0, C=0 and check that Out==0 and clk=0
  2. Reset, set A=0, B=0, C=1 and check that Out==1 and clk=0
  3. Reset, set A=1, B=1, C=0 and check that Out==1 and clk=0
  4. Tick, set A=0, B=1, C=0 and check that Out==0 and clk=1
  5. Tick, set A=1, B=1, C=1 and check that Out==1 and clk=0
  6. Reset, set A=0, B=0, C=0 and not check Out but clk=0
  7. Tick, set A=1, B=0, C=1 and check that Out is floating (in Logisim this is notated as U) and clk=1
  8. Test Vector is complete

Anterior: Valores Especiais | Próximo: Uso da Linha de Comando.