Altera_Forum
Honored Contributor
13 years agomodelling interarrival times
Hello,
I am interested to model inter arrival times for my design based on exponential distribution. I first tried to write a simple model which given below. I have two clarifications: a. when i try to use the $rdist_exponential(), Modelsim throws up the error [TOFD] - System task or function '$rdist_exponential' is not defined. b. Is there any possible way to write a simple exponential distribution function like in C. When I searched the web for exponential distribution modeling using verilog, i found some model (attached), which I am not able to follow. Any suggestion is welcome..
module expdis(clk,reset);
input clk,reset;
integer a ;
reg b;
always@(posedge clk)
if(!reset)
begin
b = {$random} % 10 ;
a = $dist_exponential(b,21);
end
else
begin
a = 0;
b = 0;
end
always@(posedge clk)
$display("a = %d b= %d", a,b);
endmodule
regards, Manihatn