Waiting for an event in uvm seq or uvm object

Hey all ! I hope that you guys all doing good.
I tried to define an event in scoreboard that will be trigger after some processing, then i wait for it to do some routine.
But i get compilation error : event may not be used in non-procedural context
Did any of you encounter this problem if yes how did you solve it ?
thnaks in advance.

In reply to abdelaali_21:

You need to show some code - context is very important.

In reply to dave_59:

Hey Dave, thanks for you reply.
In order to check if a signal will high after that dut did some transefers before moving to another transfers. For that purpose, i’m checking on that signal in the scoreboard, then trigger an event ( → scb2seq_new_tr) to tell to sequence to send a new transfer.
So when i made wait(scb2seq_new_tr); it gave me the error :
event may not be used in non-procedural context

In reply to abdelaali_21:

That is not enough code to show the context. See How to ask better questions.

In reply to dave_59:

Hey Dave,
here’s a pseudo-code :

in scoreboard :
event scb2seq_new_tr;
// build phase
// connect phase
// run phase
// checkers
// when a=a_max; ( dut must assert signal b)
// → scb2seq_new_tr ( trigger this event to inform seq to send new item.

in seq :
env m_env
// construct : get env from config_db
// pre_body : ceate seq item
// body :
send an item
// wait(m_env.m_scoreboard.scb2seq_new_tr ) wait for event in scorboard to send a new item
send new item

In reply to abdelaali_21:

I believe you want

@(m_env.m_scoreboard.scb2seq_new_tr)

But I would use the uvm_event class.

In reply to dave_59:

Hey Dave, I triggered the event in scoreboard and add @(m_env.m_scoreboard.scb2seq_new_tr) in seq
but simulation don’t preceed for the code after @(m_env.m_scoreboard.scb2seq_new_tr) . It’s like the evnet wasn"t triggered which illogical

In reply to abdelaali_21:

Hey Dave,
Since the eralier technique didnt work, I tried a new one and it worked.

in scoreboard :
int tr_ended=0;
// build phase
// connect phase
// run phase
tr_ended=0; // initialization
// checkers
// when a=a_max; ( dut must assert signal b)
// tr_ended=1;

in seq :
env m_env
// construct : get env from config_db
// pre_body : ceate seq item
// body :
send an item
// while(m_env.m_scoreboard.tr_ended!=1) wait a clock cycle
send a new item