Docsity

Floating Point Addition Testing: Verification Plans, Random Stimulus, Directed Tests (80 c, Slides of Verilog and VHDL

Partial preview of the text

Download Floating Point Addition Testing: Verification Plans, Random Stimulus, Directed Tests (80 c and more Slides Verilog and VHDL in PDF only on Docsity!

Directed Random Test

Lecture overview

  • Open discussion of Verification Plan on Project A - Verification Plans are living documents ???
  • Generation of Random Stimulus
  • Directed Random Tests
  • An Example

Totally Random vs Constrained Random

  • Consider the Floating Point Adder
    • If the 32 bits are randomly generated
      • Most likely a normalized number (probability very high)
      • Occurrences of NaN, +/- Inif, and 0 will be very minimal
        • some may not even occur over several thousand vectors
    • Constrain the random generation so that all cases are adequately covered.

Testing the Floating Point Adder

  • Step 1 โ€“ have adequate test of each class +/- each other class - Nan and each of - +/- Inifity - +/- 0 - +/- Normalized number - +/- Denormalized number - For the case of normalized and denormalized must have adequate number of case to insure conficence

The real work

  • Special cases covered โ€“ Nan, Inif, and 0 are specific formats and limited to just 6 vectors
  • Normalized and denormalized vectors make up the rest of the 2 64 vector space with normalized number making up the bulk of that space.

Specific tests for these

  • Special cases that you want to test for โ€“ and you want more than testing one instance - You add two large normalized numbers and the result is the largest representable normalized number - You add two large normalized numbers and the result overflows to Inifinity - You add a large normalized number and a small normalized number and the result is the largest representable normalized number - You add a large normalized numbers and a small normalized number and the result overflows to Infinity

More test for the boundary

  • Add/Subtract two denormalized numbers with the result beign - The smallest normalized number - The largest denormalized number
  • One you are confident you have the boundary conditions covered you can now use random test generation

The bulk of the operational space

  • These special cases are less than 1% of the total test space.
  • Need to apply vectors such that your confidence is high that all parts of the unit have been sufficiently exercised.
  • Can design test vectors to specifically test having a result with a leading 1 bit in each position.
  • Can have test vectors that result in no carry ripple and those that have maximum carry ripple

Constraining the random

  • Want to subtract a normalized and denormalized to get either a normalized or denorm result. - Set the exponent and sign - Generate the fractional part randomly but constrain the range of the random value generated such that the result will be in a range to realized the test objective.

Generation of Random Vectors

  • Numerous ways to generate the random vectors - C or C++ program - MATLAB script or program - By hand (but only for very limited cases) - A combination of these and others