Jump to content

[uvm_phase] on-the-fly reset example and discuss


Recommended Posts

Hi UVM Experts,

I am trying to organize a guideline to achieve the on-the-fly reset discussed in the Cypress' paper.

http://events.dvcon.org/events/proceedings.aspx?id=131-2

The steps:

1. component: reset valuables, queue in pre_reset_phase.

2. sequence: release all resources such as semaphores in do_kill()

3. execute the on-the-fly reset in uvm_test as the example below.

virtual task main_phase(uvm_phase phase);
  // after some events or random 
  phase.jump(uvm_pre_reset_phase::get());
  phase.phase_done.clear(); // Question 1
  foreach (sqr[i]) sqr[i].stop_sequences(); // Question 2
endtask: main_pahse

Question 0: It already works in my simple example, however, I am not sure is there anything that I did not take into consideration? please give me some hints and thanks!

Question 1: do you suggest to use "phase.phase_done.clear(); directly to end the main_phase? is there any risk or there exists better alternative.

Question 2: to make sequence::do_kill() invoked by all sequences, is there better way than finding all sequencer handles and perform stop_sequences()?

thanks in advanced!

Link to comment
Share on other sites

The uvm_phase::jump() clears the phase done objection, so you don't really need the explicit clear afterwards. You could find all the sequencer handles and call stop_sequences() just before the jump. If you have multiple domains, make sure you check the domain of the sequencer matches what you are jumping. The stop_sequences() resolves problems in the sequencer-sequence interaction. You may also have to consider problems in the sequencer-driver interaction -- if your driver calls get_next_item() and then due to reset the sequence is killed, a subsequent item_done() from the driver will cause an error.

An alternative we are using is to replace using jump with setting a notification flag in the config_db and then clearing the phase_done manually. That will cause all components in the domain to get a phase_ready_to_end() callback, which we use in the sequencer to kill sequences (when the notification flag is present).

Link to comment
Share on other sites

Thanks for mastrick's sharing,

In my understand, uvm_phase::jump only set the next phase to go, and it will really go to the phase when all drop. that's why I need to clear it explicitly.

About the driver's problem, for example, the driver:

1. set jump from main_phase to pre_reset_phase

2. get the item at 1ns and plan to invoke item_done in 3ns

3. phase.done.clear in 2ns

4. I originally think the driver stops executing main_phase and to pre_reset_phase() at this monent, and will not execute item_done, so the probelm stated before will not happen, am I correct?

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...