D
Deepu
Guest
Hi,
I have a function as below and would like to get some help on making
sure how i get unique numbers everytime this function is called & if
the 'number' passed to this function is always '0'.
function int fn_get_number (
input int number = 0
);
int temp_number;
case (number)
16'd0 : temp_number = 0 + {$random(seed)} % 11;
16'd1 : temp_number = 12 + {$random(seed)} % 11;
16'd84 : temp_number = 100 + {$random(seed)} % 11;
16'd999 : sector_number = {$random(seed)} % 1000;
endcase
fn_get_number = temp_number;
endfunction
Thanks for your time.
I have a function as below and would like to get some help on making
sure how i get unique numbers everytime this function is called & if
the 'number' passed to this function is always '0'.
function int fn_get_number (
input int number = 0
);
int temp_number;
case (number)
16'd0 : temp_number = 0 + {$random(seed)} % 11;
16'd1 : temp_number = 12 + {$random(seed)} % 11;
16'd84 : temp_number = 100 + {$random(seed)} % 11;
16'd999 : sector_number = {$random(seed)} % 1000;
endcase
fn_get_number = temp_number;
endfunction
Thanks for your time.