# What is the difference between pre randomization and post randomization methods?

**URL:** <https://verificationacademy.com/forums/t/what-is-the-difference-between-pre-randomization-and-post-randomization-methods/28266>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog\
**Created:** [December 20, 2012, 7:00am UTC](https://verificationacademy.com/forums/t/what-is-the-difference-between-pre-randomization-and-post-randomization-methods/28266 "2012-12-20T07:00:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mperyer](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@mperyer](https://verificationacademy.com/forums/u/mperyer)\
**Post date:** [December 20, 2012, 9:54am UTC](https://verificationacademy.com/forums/t/what-is-the-difference-between-pre-randomization-and-post-randomization-methods/28266/2 "2012-12-20T09:54:04Z")

</div>

When you call the randomize() method on a SV class, then the following methods are called in order:

pre\_randomize()  
randomize()  
post\_randomize()

A user can overload the pre\_randomize() and post\_randomize() methods but not the randomize() method. The pre-randomize() method is used to set up variables that are used in constraints during the randomize() method. The post-randomize() method is used to calculate values based on the results of the randomize() method.

---

_[View the full topic](https://verificationacademy.com/forums/t/what-is-the-difference-between-pre-randomization-and-post-randomization-methods/28266)._
