From f022b48133bc1884e49a1af5030d64df3581d516 Mon Sep 17 00:00:00 2001 From: hneemann Date: Wed, 13 Sep 2017 21:49:56 +0200 Subject: [PATCH] improved test case help text --- src/main/resources/lang/lang_de.xml | 56 ++++++++++++++--------------- src/main/resources/lang/lang_en.xml | 49 ++++++++++++------------- 2 files changed, 52 insertions(+), 53 deletions(-) diff --git a/src/main/resources/lang/lang_de.xml b/src/main/resources/lang/lang_de.xml index a47e0d8fe..7667bdf88 100644 --- a/src/main/resources/lang/lang_de.xml +++ b/src/main/resources/lang/lang_de.xml @@ -1056,7 +1056,9 @@ Mehrere Ausdrücke können durch "," oder ";" getrennt werden. Sollen die Ausdrücke benannt werden, kann die let-Anweisung verwendet werden: "let U=A+B, let V=A*B" Testvektoren - + + +

Die erste Zeile muss, durch ein Leerzeichen getrennt, die Ein- und Ausgänge auflisten. In den folgenden Zeilen stehen dann die Sollwerte. Dabei steht ein 'X' für Don't Care, und ein 'Z' für hochohmig. @@ -1065,19 +1067,17 @@ Taktzyklus durchgeführt, und erst daran anschließend werden die Werte verglich Auf diese Weise können Schaltwerke einfacher getestet werden. Eine Zeile, die mit einem Doppelkreuz ('#') beginnt ist ein Kommentar.

Ein Test für einen 2-Bit Zähler könnte damit wie folgt aussehen:

-

- -C Q1 Q0
-0 0 0
-C 0 1
-C 1 0
-C 1 1
+ +

+C Q1 Q0
+0 0  0
+C 0  1
+C 1  0
+C 1  1
 C 0  0
-
-

-

-Gestartet werden die Tests über Start->Tests ausführen. -

+
+ +

Gestartet werden die Tests über Start->Tests ausführen.

Um vereinfacht sehr viele Tests durchzuführen existiert die 'repeat([n])' Anweisung: Beginnt eine Zeile mit 'repeat([n])' werden [n] Testzeilen erzeugt. Dabei kann die @@ -1088,13 +1088,12 @@ bits([bits],[value]) Anweisung. Mit dieser werden [bits] Bits des Wertes [value]

Im folgenden ein Beispiel, welches einen 4-Bit Addierer testet:

-

- - C_i-1 A_3 A_2 A_1 A_0 B_3 B_2 B_1 B_0 C_i S_3 S_2 S_1 S_0
-repeat(256) 0 bits(4,n>>4) bits(4,n) bits(5,(n>>4)+(n&15))
+

+           C_i-1  A_3 A_2 A_1 A_0  B_3 B_2 B_1 B_0  C_i S_3 S_2 S_1 S_0
+repeat(256)  0    bits(4,n>>4)     bits(4,n)        bits(5,(n>>4)+(n&15))
 repeat(256)  1    bits(4,n>>4)     bits(4,n)        bits(5,(n>>4)+(n&15)+1)
-
-

+
+

Die Eingangssignale sind das Carry-In (C_i-1) und die acht Eingangsbits A_3-A_0 und B_3-B_0. Erzeugt werden die jeweils 4 Eingangsbits mit der 'bits'Anweisung. Das Ergebnis (C_i,S_3-S_0) wird ebenfalls durch eine 'bits'-Anweisung erzeugt. @@ -1104,17 +1103,16 @@ Eingangskonfigurationen abdecken.

Sollen mehrere Zeilen wiederholt werden, oder werden geschachtelte Schleifen benötigt, kann die loop-Anweisung verwendet werden. Das obige Beispiel könnte man also auch wie folgt umsetzen:

-

- - C_i-1 A_3 A_2 A_1 A_0 B_3 B_2 B_1 B_0 C_i S_3 S_2 S_1 S_0
-loop(a,16)
- loop(b,16)
- 0 bits(4,a) bits(4,b) bits(5,a+b)
- 1 bits(4,a) bits(4,b) bits(5,a+b+1)
- end loop
+ +

           C_i-1  A_3 A_2 A_1 A_0  B_3 B_2 B_1 B_0  C_i S_3 S_2 S_1 S_0
+loop(a,16)
+  loop(b,16)
+             0    bits(4,a)        bits(4,b)        bits(5,a+b)
+             1    bits(4,a)        bits(4,b)        bits(5,a+b+1)
+  end loop
 end loop
-
-

+
+ ]]>
\ No newline at end of file diff --git a/src/main/resources/lang/lang_en.xml b/src/main/resources/lang/lang_en.xml index e791d28eb..922f749ec 100644 --- a/src/main/resources/lang/lang_en.xml +++ b/src/main/resources/lang/lang_en.xml @@ -1038,7 +1038,9 @@ Multiple expressions can be separated by "," or ";". If you want to name the expressions you can use the let-command: "let U=A+B, let V=A*B"
Test vectors - + + +

The first line has to contain the names of inputs and outputs. The following lines contain the expected values. A 'X' represents a don't care, and a 'Z' represents a high Z value. @@ -1048,14 +1050,14 @@ A line which starts with a number sign ('#') is a comment.

So a test for a 2-bit counter could look like this:

-

-C Q1 Q0
-0 0 0
-C 0 1
-C 1 0
-C 1 1
+

+C Q1 Q0
+0 0  0
+C 0  1
+C 1  0
+C 1  1
 C 0  0
-

+

The tests are executed by Run->Run Tests.

@@ -1068,13 +1070,12 @@ and these are to be set together to a binary value, this can be done with the

The following is an example that tests a 4-bit adder:

-

- - C_i-1 A_3 A_2 A_1 A_0 B_3 B_2 B_1 B_0 C_i S_3 S_2 S_1 S_0
-repeat(256) 0 bits(4,n>>4) bits(4,n) bits(5,(n>>4)+(n&15))
+

+           C_i-1  A_3 A_2 A_1 A_0  B_3 B_2 B_1 B_0  C_i S_3 S_2 S_1 S_0
+repeat(256)  0    bits(4,n>>4)     bits(4,n)        bits(5,(n>>4)+(n&15))
 repeat(256)  1    bits(4,n>>4)     bits(4,n)        bits(5,(n>>4)+(n&15)+1)
-
-

+
+

The input signals are the carry-in (C_i-1) and the eight input bits A_3-A_0 and B_3-B_0. The 4 input bits are generated with the 'bits' instruction. The result (C_i, S_3-S_0) is also generated by a 'bits' instruction. @@ -1082,17 +1083,17 @@ This happens once with C_i-1 = 0 and in the next line with C_i-1 = 1. In this way, 512 test rows are generated which cover all possible input configurations.

If multiple rows are to be repeated, or if nested loops are required, the loop statement can be used. The above example could also be implemented as follows:

-

- - C_i-1 A_3 A_2 A_1 A_0 B_3 B_2 B_1 B_0 C_i S_3 S_2 S_1 S_0
-loop(a,16)
- loop(b,16)
- 0 bits(4,a) bits(4,b) bits(5,a+b)
- 1 bits(4,a) bits(4,b) bits(5,a+b+1)
- end loop
+ +

+           C_i-1  A_3 A_2 A_1 A_0  B_3 B_2 B_1 B_0  C_i S_3 S_2 S_1 S_0
+loop(a,16)
+  loop(b,16)
+             0    bits(4,a)        bits(4,b)        bits(5,a+b)
+             1    bits(4,a)        bits(4,b)        bits(5,a+b+1)
+  end loop
 end loop
-
-

+
+ ]]>
\ No newline at end of file