Jump to content
Sign in to follow this  
DanaL

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×