Transaction Recording - Creating custom streams Questa 10.1b UVM 1.1

Goal: I would like to get transaction recording in Questa 10.1b to work in a useful way. I want to create a transaction stream for every UVM Monitor I instantiate and be able to add it to my wave by clicking through the hierarchy in the structure window, ie:

/uvm_root/uvm_test_top/env/agent/monitor
( and then click on it’s stream in the object window)

Notes:

  • I am using the pre-compiled uvm version that came with Questasim
  • I pass -uvmcontrol=all flag into the simulation.
  • I have set recording detail in the top_level test

Once transactions appear on a sequencer, QuestaSim automatically creates a trStream for each uniquely named transaction which I can add through the structure window. (locate sequencer and select from object window).

What I want is a single stream that shows all transaction traffic on an interface (which I then have a monitor for) instead of an individual stream for each unique transaction name. This is also appealing because it lets me view transactions passively read off of an interface, while a sequencer does not.

So I looked into the Questa documentation to create custom streams and added to the monitor’s build method:

function void st_monitor::create_streams();

   string  name = { "..", get_full_name(), ".", "raw_stream" };
   string  type_name = "raw_packet";
   h_raw_stream = $create_transaction_stream( name, type_name );

endfunction

then every time I receive a transaction on the monitor’s import:

trans = $begin_transaction( h_raw_stream, pkt.get_name(), pkt.start_time );
   // <add some code here to somehow call their do_record functions and $add_attribute to trans>
   $end_transaction( trans, pkt.end_time, 1 );

The trouble is, the transaction stream doesn’t appear in the hierarchy like the sequencer’s specific transactions do, instead the only path I can reach my newly created stream at is:

/uvm_pkg::uvm_phase::m_run_phases/raw_stream

(which I determined by viewing the vsim.wlf file)

And even then I only see a single stream with the combined traffic of all monitors, instead of a separate transaction stream for every monitor.

The questa documentation for naming conventions of $create_transaction_stream( stream_name, stream_kind ) dictate:
For OVM designs, the string specified must adhere to the following format:
{“…”,get_full_name(),“.”,“your_name”}

(Since I am using UVM instead of OVM maybe this is no longer valid.)

Summary:
I think I am fairly close to getting transaction recording working in a useful way, any advice on how to:

  1. Make the custom transaction streams (there should be 1 per monitor) appear in the UVM hierarchy so they can be easily added to the wave window.
  2. Call the do_record function using trans handle to automatically $add_attribute() for all fields in my transaction type.

Any help would be greatly appreciated!!

I take it not very many people have experience with transaction recording… for anyone who is interested it looks pretty useful: (you need a mentor account)

@ 39:00 He talks for a couple minutes about displaying transactions in the wave window.

In his example he even added transaction streams to the monitor and driver. I can’t find any concrete examples on how to do this myself…

In reply to bpwall:

I just reverse-engineered the code visible in the webinar you referenced with QuestaSim 10.4a and it worked perfectly. I did the following …

m_txn = mil1553bc_txn::type_id::create(“m_txn”);
void’(begin_tr(m_txn, “Monitor_Stream”));
… // do the monitoring
end_tr(m_txn);

The result was that a stream named Monitor_Stream is created as member of the monitor class instance and is shown in the Objects window. It is also visible in the UVM Details window. However, and that was a pitfall for me, it is only created when begin_tr is called for the first time i.e. after the first transaction is monitored, and not already when calling “run 0” after elaboration. You probably had $create_transaction_stream in the constructor of the monitor, which was also the natural place for me.

What I do not understand however is why the QuestaSim User Manual still describes the system calls like $begin_transaction and $end_transaction as means of transaction recording, with the deficits you experienced apparently still in place, and does not mentioned begin_tr and end_tr at all. Maybe there’s a reason, but currently I can’t see it.