Spent long time cracking your head how to get rid of this error?
The first thing to notice when we see "pointer" is that this is related to memory allocation. There are two conditions on which we get this error.
Use the following code initially once:
set_config_object("*","object_name", object_name_handle, .clone(0));
Use the following check whenever you want to use this object out side the scope:
object_class_name object_name_handle;
ovm_object ovm_object_handle;
if (!this.get_config_object("object_name_handle",ovm_object_handle,.clone(0)))
begin
`ovm_info(report_id,"object_name_handle is not instantiated",OVM_MEDIUM);
return;
end
if (!$cast(object_name_handle, ovm_object_handle))
begin
`ovm_error(report_id, "object_name_handle cast failed");
end
The first thing to notice when we see "pointer" is that this is related to memory allocation. There are two conditions on which we get this error.
- When memory is not yet available for this particular object (the name of the object will be available in the error description).
- Memory is available (object already created), but the handle which we declared may not have a connection(reference) to it.
Use the following code initially once:
set_config_object("*","object_name", object_name_handle, .clone(0));
Use the following check whenever you want to use this object out side the scope:
object_class_name object_name_handle;
ovm_object ovm_object_handle;
if (!this.get_config_object("object_name_handle",ovm_object_handle,.clone(0)))
begin
`ovm_info(report_id,"object_name_handle is not instantiated",OVM_MEDIUM);
return;
end
if (!$cast(object_name_handle, ovm_object_handle))
begin
`ovm_error(report_id, "object_name_handle cast failed");
end