UVM sequence scoreboard problem. in what order does the run_phase get executed?


Clarify the problem:
in my test, it is just
task run_phase();
A.start();
endtask

B is a scoreboard, and in the run phase it frees the token.
In B run_phase:
super.run_phase();
Forever begin
if()
freeToken();
end

A is a sequence , and here what going on is:

task body();

while() begin
if(getToken())
break;
end
endtask

there is a interlock going on between A and B. in A, there is a loop which wait for B to free a token. However it seems A just wait forever and B never get executed if I code them like this. Am I understanding something wrong? It might be the loop part going wrong but when I remove the loop thing, it seems fine.
Any ideas?

In reply to Guozhu He:

Can you post the body methods of your 2 sequences?

In reply to bmorris:

Oh. My previous statement is wrong. Actually B is a scoreboard.

In B run_phase:
super.run_phase();
Forever begin
if()
freeToken();
end

A is a sequence , and here what going on is:

task body();

while() begin
if(getToken())
break;
end
endtask

In reply to Guozhu He:

while() begin
 if(getToken())
 break;
 end

Does getToken() have any blocking statements in it? Otherwise, this may lock up your simulator.

Forever begin
 if()
 freeToken();
 end

Why do you have a blank if() statement? I’m having trouble understanding the intent of your code. Could you post the freeToken and getToken methods?

In reply to bmorris:

run_phase of all the components created run in parallel like in a fork join statement.

But there is no run_phase in sequences (there is whole set of different way of communication btw sequences/sequences and driver that need to be looked on)and hence your code is not working in way you want it do.

Hope this helps.