Prabhu Posted July 13, 2011 Report Posted July 13, 2011 Hi I have a class like this class A ; int a; a dist {1:=10,2:=5,3:=6} endclass which type of randomization would give best distribution of the random valuesType 1: A rand_obj; for(int count = 0;count <100;count++) begin rand_obj = new() rand_obj.randomize(); end Type2: A rand_obj,rand_obj2; rand_obj = new(); for(int count = 0;count <100;count++) begin rand_obj.randomize(); rand_obj2 = rand_obj.deep_copy(); end My understanding is as follows Type 2 would give better constraint coverage(meaning distribution) but overriding is a pain I have two questions 1.Which one is better ? 2.What does the macro `uvm_do implements (Is is the anyone above or some thing else) ? cheers Prabhu.G Quote
dave_59 Posted July 13, 2011 Report Posted July 13, 2011 If you have a cyclic randc variable (btw you forgot to declare a as rand), only type 2 will work. As far as distributions are concerned, it should not matter. Solutions are produced based on probabilities without considering previous results. Type 2 is also good if you have non-rand state variables that are used in your constraints. If you mean type 2 is harder to do factory overrides dynamically, yes that is true. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.