source: vis_dev/vis-2.1/examples/fpmpy/fpmpy.ctl @ 12

Last change on this file since 12 was 11, checked in by cecile, 13 years ago

Add vis

File size: 1.4 KB
Line 
1# Define common subformulae.
2\define START   (start=1 * FPM.state[1:0]=0)
3\define Validx  (x[6:3]=0 -> x[2:0]=0)
4\define Validy  (y[6:3]=0 -> y[2:0]=0)
5\define Validz  (z[6:3]=0 -> z[2:0]=0)
6\define NaNx    (x[6:3]=b1111 * !(x[2:0]=0))
7\define NaNy    (y[6:3]=b1111 * !(y[2:0]=0))
8\define NaNz    (z[6:3]=b1111 * !(z[2:0]=0))
9\define Infx    x[6:0]=b1111000
10\define Infy    y[6:0]=b1111000
11\define Infz    z[6:0]=b1111000
12
13#PASS: Legal operands cannot produce illegal results. The only illegal
14# operands in our case are the denormals.
15
16AG((\START * \Validy * \Validx) -> AX:3(\Validz));
17
18#FAIL: If the sign bits are different the result is negative.
19# This formula fails because one operand may be NaN.
20
21AG((\START * !(y[7]==x[7])) -> AX:3(z[7]=1));
22
23#PASS: If the sign bits are the same the result is positive.
24
25AG((\START * y[7]==x[7]) -> AX:3(z[7]=0));
26
27#PASS: If one of the operands is NaN the result is NaN.
28
29AG((\START * (\NaNy + \NaNx)) -> AX:3(\NaNz));
30
31#FAIL: If one of the operands is zero and the other operand is
32#      not NaN the result is zero.
33# These properties should fail, because infinity * zero = NaN.
34
35AG((\START * y[6:0]=0 * !\NaNx) -> AX:3(z[6:0]=0));
36AG((\START * x[6:0]=0 * !\NaNy) -> AX:3(z[6:0]=0));
37
38#PASS: If one of the operands is infinite and the other operand is
39#      neither NaN nor zero the result is infinite.
40
41AG((\START * \Infy * !\NaNx * !(x[6:3]=0)) -> AX:3(\Infz));
42AG((\START * \Infx * !\NaNy * !(y[6:3]=0)) -> AX:3(\Infz));
Note: See TracBrowser for help on using the repository browser.