Jump to content

Returning event from virtual function


Recommended Posts

Hello,

I'm experiencing a problem - 

I have my agent, which had the following function:

virtual function event get_mon_event();
        return monitor.mon_e;
endfunction

And my env, which runs on all of those agents (a couple of them, in an array): [As a part of a task]

for (int i=0; i<some_number; ++i) begin
    fork
                    automatic int var_i = i;
                    begin
                        // wait for the first event from any agent to generate this event
                        @(p_agent[var_i].get_mon_event());
                    end

    join_none;

end 

 

I'm getting this error:

[SV-VFIEWC] Virtual function in event/wait control - Call to virtual function 'p_agent_base::get_mon_event' cannot be used in event or wait control.

Can someone explain why this is happening and offer a solution please?

 

Thanks!

Dana

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...