Test Generation for the Binary Floating

Point Add Operation With

Mask-Mask-Mask Constraints

::  Credits   ::  Abstract   ::  Requirements   ::  User interface   ::  Design   ::  Tools  ::
Credits
By:
  • Ali Ayoub.
  • Hatim Ayoub.

Instructed by:

  • Technion:
    • Dr. Yosi Gil.
    • Shahar Dag.
  • IBM:
    • Abraham Ziv.
    • Sigal Asaf.
    • Raviv Nagel.

Abstract:

The mathematical problem discussed is important for generating test cases in order to debug floating point adders designs. Floating point numbers are assumed to be written as strings of {0, 1} bits, in a format compatible with IEEE standard 754. A mask is a string of characters, composed of {'0', '1', 'x'}. A number and a mask are compatible if they have the same length and each numerical character of the mask ('0' or '1') is equal, numerically, to the bit of the number, in the same position. The problem discussed is: Given masks Ma, Mb, Mc, of identical lengths, generate three floating point numbers a, b, c which are compatible with the masks and satisfy c=round(aħb). If there are many solutions, choose one at random. A fast algorithm* is given which solves the problem for all IEEE floating point data types and all rounding modes.

 
[*] As written in the article "Test Generation for the Binary Floating Point Add Operation With Mask – Mask – Mask Constraints", Abraham Ziv, Laurent Fournier, IBM Israel Science Technology, Haifa, Israel. October 3, 2002.

Requirements

Given masks for three machine numbers, generate machine numbers,, , , which are compatible with the masks and satisfy . This problem may be split into sub-problems, which may be solved by two generators of machine numbers, respectively:

Floating point generator for addition Given six masks, for biased exponents and for significands, Mea, MSa, Meb, MSb, Mec, MSc, the generator either generates three non-negative machine numbers,, , , whose biased exponents and whose significands are compatible with the corresponding masks and satisfy,, or states that there is no solution.

Floating point generator for subtraction Given six masks, for biased exponents and for significands, Mea, MSa, Meb, MSb, Mec, MSc, the generator either generates three non-negative machine numbers,, , , whose biased exponents and whose significands are compatible with the corresponding masks and satisfy, , or states that there is no solution.

The generators should be fast as possible. In case there exist more than one solution, a generator chooses one of them at random. Multiple invocations of the generator, are supposed to make independent random choices.

This project is an implementation of the algorithm described in the article "Test Generation for the Binary Floating Point Add Operation With Mask – Mask – Mask Constraints" By Abraham Ziv, Laurent Fournier. IBM Israel Science Technology. October 3, 2002.

 


User interface:
 
  • FYI: for more information about the compatible binaries for the following user interface please contact ssdl@...
  • Command Line Interface

Name:

FGgenMMM – floating point test generator

Syntax:

FPgenMMM  <input_file 1>  .....  <input_file n>  <X's proportion>

Description:

FPgenMMM is a floating point generator, it is used for test generation for the the floating point add / sub operations with mask – mask – mask constraints.

It takes n+1 parameters, when n is the number of the input files:

  •  <input_file i>: input file number i. Line in the file is one of the two options:

 [RoundingMode = "ROUND"], when "ROUND" is on of the options:

·        binary_zero

·        binary_neginf

·        binary_posinf

·        binary_nearest

      Example: RoundingMode = binary_posinf

 [operationN hexadecimal_1 hexadecimal_2 hexadecimal_3], when

hexadecimal_3 = Round(hexadecimal_1 operation hexadecimal_2):

·        operation:

§        add – add operation

§        sub – sub opreration

·        N:

§         32 – 32 bit

§         64 – 64 bit

§         128 – 128 bit

·        hexadecimal_i: Hexadecimal number, the length is N.

·        Round: The latest round mode mentioned in the file.

      Examples: add32 0x67d922c7 0x9c7baa94 0x67d922c7

  •  <X's proportion>: a number between 0 and 1 which is the proportion of bits we want turned into "x".

Output:

  • out.txt: includes the same data from the input file but with binary numbers (and not hexadecimal).
  • stdout: print "true" if there is a solution, else print "false".

 

  • GUI Interface:

o       Main Dialog: given three binary masks, operation, round mode, and returns three numbers compatible with the given masks as a solution.

o       Randomizer Dialog: sets a random input vectors according to the parameters appear in the dialog.

o       No Solution Dialog: this dialog appears if there is no solution.


Design:
  • Use case diagrams

  • Algorithms

  • Class diagrams

  • Sequence diagrams

A word document including the above diagrams can be downloaded here .

For project documentation, CppDoc 2.0. tool was used. please contact ssdl for further information.


Tools:

o      Programming Language:

  •  C++

o      Design Tools:

  • Rational Rose

  • Microsoft Visio Drawing

o      Compiled with:

  • MS visual 6.0

  •  Redhat 9.0 g++

o      GUI:

  • MFC

o      Documentation Tool:

::  Credits   ::  Abstract   ::  Requirements   ::  User interface   ::  Design   ::  Tools  ::

This site includes no source code related to the project implementation, for any further information please contact Technion ssdl (System and Software Development Laboratory).