SlideShare a Scribd company logo
1 of 17
PRESENTED BY
NISHA K.P.
BL.EN.P2.VLD.12013
Randomisation
INTRODUCTION
 As designs grow larger, it becomes more difficult to
create a complete set of stimuli
 needed to check their functionality.
 Directed test cases can be written to check a certain
set of features,
 The number of features keeps doubling on each
project.
 The solution is to create test cases Automa- tically
using constrained-random tests (CRT).
 A directed test finds the bugs you think are there, but a
CRT finds bugs you never thought about, by using
random stimulus.
 Trade-off of test-authoring time (your work) for CPU
time (machine work) is what makes CRT so valuable.
 A simple directed test just applies stimulus, and then
manually check the result.
 These results are captured as a golden log file and
compared with future simulations to see whether the
test passes or fails.
 A CRT environment needs not only to create
the stimulus but also to predict the result.
 A CRT is made of two parts:
 The test code that uses a stream of random values to
create input to the DUT.
 A seed to the pseudo-random number generator
(PRNG).
 Just by changing seeds, each test can be made the
functional equivalent of many directed tests
What can be Randomized?
 Integral variables, that is, variables that contain a
simple set of bits.
 Randomization only works with 2-state values. Can
have integers, bit vectors, etc.
 Can’thave a random string, or refer to a handle in a
constraint.1
 Call $random.
 Only find data-path
bugs, perhaps with bit-
level mistakes.
 The test is still
inherently directed.
 The challenging bugs -
control logic.
 As a result, you need to
randomize all decision
points in your DUT.
 Wherever control paths
diverge, randomization
increases the probability
that you’ll take a
different path in each
test case
DESIGN INPUTS
 Device configuration
 Environment
configuration
 Primary input data
 Encapsulated input data
 Protocol exceptions
 Delays
 Transaction status
 Errors and violations
 Protocol exceptions
RANDOM STIMULUS GENERATION
 Most useful when used with OOPs.
 First create a class to hold a group of related random
variables.
 Then have the random-solver fill them with random
values
 . You can create constraints to limit the random values
to legal values, or to test-specific features.
SIMPLE RANDOM CLASS
class Packet;
// The random variables
rand bit [31:0] src, dst,
data[8];
randc bit [7:0] kind;
// Limit the values for src
constraint c {src > 10;
src < 15;}
endclass
Packet p;
initial begin
p = new();// Create a
packet
assert (p.randomize())
else $fatal(0,
"Packet::randomize
failed");
transmit(p);
end
 Randc - means random cyclic,
 The random solver does not repeat a random value until
every possible value has been assigned
 A randc array with eight elements has eight different
patterns
 Grouped using curly braces: {}.
 code is declarative, not procedural.
 A constraint is just a set of relational expressions
that must be true for the chosen
value of the variables.
 The randomize() function returns 0 if a problem is
found with the constraints.
Checking the Result
 The randomize() function assigns random values to any
variable in the class that has been labeled as rand or randc
 Also makes sure that all active constraints are obeyed.
 May fail due to conflicting constraints.
 One should always check the status, else, the variables
may get unexpected values, causing your simulation to
fail.
 checks the status from randomize() by using a procedural
assertion.
 If randomization succeeds, the function returns 1.
 If it fails, randomize() returns 0.
 $fatal stops the simulation.
.
 The assertion checks the result and prints an error if
there was a failure. The simulator’s switches should
be set to terminate when an error is found.
 The assertion checks the result and prints an error if
there was a failure.
 Alternatively, call a special routine to end simulation.
Constraint without random
variables
class Child;
bit [31:0] age; // Error Ð
should be rand or randc
constraint c_teenager {age
> 12;
age < 20;}
Endclass
 Here since there are no
random variables,
randomize() just checks
the value of child to see
if it is in the bounds
specified by the
constraint c_teenager.
Constrained-random class
class Stim;
const bit [31:0]
CONGEST_ADDR = 42;
typedef enum {READ,
WRITE, CONTROL}
stim_e;
randc stim_e kind; //
Enumerated var
rand bit [31:0] len, src, dst;
bit congestion_test;
constraint c_stim {
len < 1000;
len > 0;
if (congestion_test) {
dst inside
{[CONGEST_ADDR-
100:CONGEST_ADDR+1
00]};
src == CONGEST_ADDR;
}
else
src inside {0, [2:10],
[100:107]};
}
endclass
6.4.2 Simple Expressions

More Related Content

Similar to ppt.pptx (20)

remoto2
remoto2remoto2
remoto2
 
provacompleta2
provacompleta2provacompleta2
provacompleta2
 
finalelocale2
finalelocale2finalelocale2
finalelocale2
 
domenica2
domenica2domenica2
domenica2
 
provarealw4
provarealw4provarealw4
provarealw4
 
test2
test2test2
test2
 
prova3
prova3prova3
prova3
 
prova1
prova1prova1
prova1
 
provaoggi2
provaoggi2provaoggi2
provaoggi2
 
stasera1
stasera1stasera1
stasera1
 
provarealw2
provarealw2provarealw2
provarealw2
 
prova5
prova5prova5
prova5
 
provarealw3
provarealw3provarealw3
provarealw3
 
finalelocale
finalelocalefinalelocale
finalelocale
 
testsfw3
testsfw3testsfw3
testsfw3
 
 
provacompleta3
provacompleta3provacompleta3
provacompleta3
 
provacompleta4
provacompleta4provacompleta4
provacompleta4
 
prova7
prova7prova7
prova7
 
domenica1
domenica1domenica1
domenica1
 

Recently uploaded

Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf203318pmpc
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 

Recently uploaded (20)

Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 

ppt.pptx

  • 2. INTRODUCTION  As designs grow larger, it becomes more difficult to create a complete set of stimuli  needed to check their functionality.  Directed test cases can be written to check a certain set of features,  The number of features keeps doubling on each project.
  • 3.  The solution is to create test cases Automa- tically using constrained-random tests (CRT).  A directed test finds the bugs you think are there, but a CRT finds bugs you never thought about, by using random stimulus.  Trade-off of test-authoring time (your work) for CPU time (machine work) is what makes CRT so valuable.
  • 4.  A simple directed test just applies stimulus, and then manually check the result.  These results are captured as a golden log file and compared with future simulations to see whether the test passes or fails.  A CRT environment needs not only to create the stimulus but also to predict the result.
  • 5.  A CRT is made of two parts:  The test code that uses a stream of random values to create input to the DUT.  A seed to the pseudo-random number generator (PRNG).  Just by changing seeds, each test can be made the functional equivalent of many directed tests
  • 6. What can be Randomized?  Integral variables, that is, variables that contain a simple set of bits.  Randomization only works with 2-state values. Can have integers, bit vectors, etc.  Can’thave a random string, or refer to a handle in a constraint.1
  • 7.  Call $random.  Only find data-path bugs, perhaps with bit- level mistakes.  The test is still inherently directed.  The challenging bugs - control logic.  As a result, you need to randomize all decision points in your DUT.  Wherever control paths diverge, randomization increases the probability that you’ll take a different path in each test case
  • 8. DESIGN INPUTS  Device configuration  Environment configuration  Primary input data  Encapsulated input data  Protocol exceptions  Delays  Transaction status  Errors and violations  Protocol exceptions
  • 9. RANDOM STIMULUS GENERATION  Most useful when used with OOPs.  First create a class to hold a group of related random variables.  Then have the random-solver fill them with random values  . You can create constraints to limit the random values to legal values, or to test-specific features.
  • 10. SIMPLE RANDOM CLASS class Packet; // The random variables rand bit [31:0] src, dst, data[8]; randc bit [7:0] kind; // Limit the values for src constraint c {src > 10; src < 15;} endclass Packet p; initial begin p = new();// Create a packet assert (p.randomize()) else $fatal(0, "Packet::randomize failed"); transmit(p); end
  • 11.  Randc - means random cyclic,  The random solver does not repeat a random value until every possible value has been assigned  A randc array with eight elements has eight different patterns
  • 12.  Grouped using curly braces: {}.  code is declarative, not procedural.  A constraint is just a set of relational expressions that must be true for the chosen value of the variables.  The randomize() function returns 0 if a problem is found with the constraints.
  • 13. Checking the Result  The randomize() function assigns random values to any variable in the class that has been labeled as rand or randc  Also makes sure that all active constraints are obeyed.  May fail due to conflicting constraints.  One should always check the status, else, the variables may get unexpected values, causing your simulation to fail.
  • 14.  checks the status from randomize() by using a procedural assertion.  If randomization succeeds, the function returns 1.  If it fails, randomize() returns 0.  $fatal stops the simulation. .
  • 15.  The assertion checks the result and prints an error if there was a failure. The simulator’s switches should be set to terminate when an error is found.  The assertion checks the result and prints an error if there was a failure.  Alternatively, call a special routine to end simulation.
  • 16. Constraint without random variables class Child; bit [31:0] age; // Error Ð should be rand or randc constraint c_teenager {age > 12; age < 20;} Endclass  Here since there are no random variables, randomize() just checks the value of child to see if it is in the bounds specified by the constraint c_teenager.
  • 17. Constrained-random class class Stim; const bit [31:0] CONGEST_ADDR = 42; typedef enum {READ, WRITE, CONTROL} stim_e; randc stim_e kind; // Enumerated var rand bit [31:0] len, src, dst; bit congestion_test; constraint c_stim { len < 1000; len > 0; if (congestion_test) { dst inside {[CONGEST_ADDR- 100:CONGEST_ADDR+1 00]}; src == CONGEST_ADDR; } else src inside {0, [2:10], [100:107]}; } endclass 6.4.2 Simple Expressions