How do get a report of which sequence is currently running on a sequencer? This is for debugging/info only … I can already see I have a problem. What I want is a bit more debugging info. There are multiple sequences that can run and I want to know which is queued up to. I’d settle for getting the information (sequence by name) from the driver after get_next_item unblocks, but I don’t see how to do that either.
Just to be clear, I don’t want to know the current_grabber … I want to know which sequence is queued up to run. There is no grabbing or locking, that’s why it’s broken. But it’s broken with odd behaviour and before I simply make the problem go away with better coding I want to verify what I think is happening.
This information is in your hands. You should issue a uvm_info. Then its indicating which sequences are running.
See my example below:
task apb_default_seq::body();
`uvm_info(get_type_name(),“default sequence starting”, UVM_MEDIUM)
super.body();
item = apb_seq_item::type_id::create(“item”);
begin
start_item(item);
item.data = data;
item.addr = addr;
item.we = we;
item.delay = delay;
finish_item(item);
end
endtask
Thanks. That’s what I did, for both series of sequences up all 4 levels of layers. That’s how I know I need to see what the sequencer has to say about it. The uvm_info (above) is issued before the start_item, but I’ve even peppered each step of the sequencer body with uvm_info’s. All those can tell me is what goes on before finish_item.
I’ve got two sequences, both uvm_infoing that they are running, all is well, but what actually happens is that the second to report is jumping in. Or so say the uvm_infos by order or reporting.
I’ll do some more digging into the under-the-hood order of the get_next_item and start/finish_item events.
The driver side print should tell you who won the arbitration at a given cycle. If you want to see all lined up at SQR side, try doing sqr.print() (UVM Sequencer::do_print is equipped to print the arbitration queue).
Could you please explain how you are running your sequences. Dou you have a virtual sequence or do you start your sequences manually on your agent sequencers.
Thanks. I’m going to mark this as a solution because it looks like the best way forward. I’ve looked into the methods in both uvm_sequencer_base and uvm_seuencer_param_base, as well as just m_sequencer.print, but I don’t see any way to get just what you described “see all lined up at SQR side” (which is just what I want). I only ever see this in a print report:
arbitration_queue array 0 -
That could be because I’m calling the method when the queue is empty of course. I’ll work at this and post a solution if I figure it out.
Thanks again.
In reply to chr_sue:
I think an example will just clutter up the question. What I want to know is how to find out in any case where a sequencer has sequences queued up, what those sequences are and which is up next to execute.
Assuming all you need is to print the arb Q inside SQR whenever it gets populated, here is a trick. I did this a while back for a hanging RAPID-IO code.
class my_sqr extends uvm_sequencer;
virtual task wait_for_grant(uvm_sequence_base sequence_ptr,
int item_priority = -1,
bit lock_request = 0);
this.print();
super.wait_for_grant();
endtask : wait_for_grant
endclass : my_sqr
I don’t recall the exact code, but the idea is - right when the Q gets populated, print it.
Quick update - below is the code along with some results, hopefully this is close to what you were looking for (In my case there are 3 sequences running in parallel on a single SQR).
In reply to Srini @ CVCblr.com:
Srini,
This is great. Thanks. I changed the name to “talkative_sequencer” and prepended “Extra:” to all your print statements. This is what I get:
--------------------------------------------------------------
Name Type Size Value
--------------------------------------------------------------
sequencer talkative_sequencer - @726
rsp_export uvm_analysis_export - @735
seq_item_export uvm_seq_item_pull_imp - @853
arbitration_queue array 0 -
lock_queue array 0 -
num_last_reqs integral 32 'd1
num_last_rsps integral 32 'd1
Extra: arbitration_queue array 0 -
Extra: lock_queue array 0 -
--------------------------------------------------------------
But I never see anything in the queue. I’ve actually got a description of the testbench here http://www.yanthia.com/online/projlets/SequenceLayering/index.html
which has a link to the code on EDA playground. That example has semaphores which fix the original problem, but I still want to know how to see what’s in the queue, or rather, what sequence is next up to run.
It seems obvious that the value of
arb_sequence_q.size())
is always zero. I’m curious about your result. Do you recall ever seeing all three sequences in your report? You showed two. It might be that a single sequence item doesn’t actually sit in the queue proper. I’ll need to take a deeper look into the the uvm sequencer base classes to see what I find.