In reply to sk7799:
5% of 4Gb is 200Mb. But if you mean you want to randomly generate addresses within a set of bounds
class transaction;
rand bit [31:0] address;
bit [31:0] boundary = 32'h4000_0000; // 1GB
constraint bounds { address dist {[0:boundary-1]:/ 5,
[boundary:'1-boundary] :/ 90,
['1-boundary+1:'1] :/5 };
}
endclass