Directed Random Test 10208 Directed Random Test Copyright

  • Slides: 14
Download presentation
Directed Random Test 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat,

Directed Random Test 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 1

Lecture overview o Open discussion of Verification Plan on Project A n o o

Lecture overview o Open discussion of Verification Plan on Project A n o o o Verification Plans are living documents ? ? ? Generation of Random Stimulus Directed Random Tests An Example 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 2

Generation of Random Stimulus o o o “Random stimulus is created by a random

Generation of Random Stimulus o o o “Random stimulus is created by a random generator that can be constrained according to the verification plan. ” Often used for automatic generation of test stimulus. And easy way to generate many test cases (transactions) easily. 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 3

Totally Random vs Constrained Random o Consider the Floating Point Adder n If the

Totally Random vs Constrained Random o Consider the Floating Point Adder n If the 32 bits are randomly generated o o n Most likely a normalized number (probability very high) Occurrences of Na. N, +/- 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. 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 4

Testing the Floating Point Adder o Step 1 – have adequate test of each

Testing the Floating Point Adder o Step 1 – have adequate test of each class +/each other class n Nan and each of o o n +/- Inifity +/- 0 +/- Normalized number +/- Denormalized number For the case of normalized and denormalized must have adequate number of case to insure conficence 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 5

Continuing the tests o For +/- Inifinity n n n o For +/- 0

Continuing the tests o For +/- Inifinity n n n o For +/- 0 n n o +/- 0 +/- Normalized numbers +/- Denormalized As there + and – representations must do the tests for both and across an adequate number of vectors for each case to insure confidence 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 6

The real work o o Special cases covered – Nan, Inif, and 0 are

The real work o o 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 264 vector space with normalized number making up the bulk of that space. 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 7

Specific tests for these o Special cases that you want to test for –

Specific tests for these o Special cases that you want to test for – and you want more than testing one instance n n 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 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 8

Test for the other boundary o Test for the normalized/denormalized boundary n Add/Subtract two

Test for the other boundary o Test for the normalized/denormalized boundary n Add/Subtract two normalized numbers with the result being o o n The smallest normalized number The largest denormalized number Add/Subtract a normalized number and a denormalized number with the result beign o o 10/2/08 - Directed Random Test The smallest normalized number The largest denormalized number Copyright 2008 - Joanne De. Groat, ECE, OSU 9

More test for the boundary o Add/Subtract two denormalized numbers with the result beign

More test for the boundary o Add/Subtract two denormalized numbers with the result beign o o o 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 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 10

The bulk of the operational space o o These special cases are less than

The bulk of the operational space o o 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 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 11

The use of random o o Can use constrained random to generate a lot

The use of random o o Can use constrained random to generate a lot of test. For normalized number operation - Start by breaking up vector into fields. n n n o The sign, the exponent and the fractional part Generate the exponents randomly between 1 and 254 Generate the fractional part randomly – knowing you have the assumed 1. For Denormalized n Here only need the fractional part 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 12

Constraining the random o Want to subtract a normalized and denormalized to get either

Constraining the random o Want to subtract a normalized and denormalized to get either a normalized or denorm result. n n 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. 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 13

Generation of Random Vectors o Numerous ways to generate the random vectors n n

Generation of Random Vectors o Numerous ways to generate the random vectors n n C or C++ program MATLAB script or program By hand (but only for very limited cases) A combination of these and others 10/2/08 - Directed Random Test Copyright 2008 - Joanne De. Groat, ECE, OSU 14