Dear All,
I need to write a function (see below) in verilog for AMS transient simulation.
I could pass a real value "delta_t" as an input argument to the function but not the a real array "step_curve_coeff1 [coeff_no:0]".
Is there any way we can pass real array to a function in veriog ?
function real myfunction;
//input real step_curve_coeff1 [coeff_no:0];
input real delta_t;
//real t_fit;
begin
x=0;
//t_fit= (delta_t-mu_1-shift_total+shift_adjust)/mu_2;
t_fit= (delta_t-mu_1-shift_val+0)/mu_2;
if( delta_t <= ( shift_val-1e-12) ) begin
x=0.0;
end else if( (delta_t >= ( shift_val+clip_offset)) & (delta_t <=clip_end)) begin
for (ind_func1 = coeff_no; ind_func1 >= 0; ind_func1 = ind_func1 - 1) begin
x=x + ( step_curve_coeff[ind_func1]* pow(t_fit,ind_func1)) ;
if( ind_func1 ==0) begin
end
end
end else if( (delta_t > ( shift_val-1e-12)) & (delta_t < ( shift_val+clip_offset-0)) ) begin
x=(x_start/clip_offset)*(delta_t-shift_val);
end else if(delta_t > clip_end) begin
x=x_end;
end
myfunction = 1.02*x;
end