静态和自动任务之间有什么区别.
program class_ref;
int index,value;
class holding_values;
int ass_array[*];
task assign_value (int value,int index);
ass_array[index] = value;
endtask
function void disp(int index);
$display("%t %M:ASSOSIATIVA VALUE%d ",$time,ass_array[index]);
endfunction
endclass
initial begin
holding_values obc;
index =5;
value =88;
obc = new();
map(obc,value);
obc.disp(index);
end
task map(ref holding_values obc,ref int value );
value +=5;
obc.assign_value(value,index);
obc =null;
endtask
endprogram
Run Code Online (Sandbox Code Playgroud)
如果执行此代码,它将给出错误
参数参数在静态任务函数声明中是非法的
如果任务"map"自动运行程序.
为什么我们需要自动完成任务?静态和自动任务有什么区别?