What is the easiest way to get the data in the uvm test from monitor

I am thinking what’s the easiest way (or say the common way) to get the data from monitor in our uvm test directly ?

here is a snippet code of my_monitor.svh

forever begin
wait(xxxx.send)
if(xxxx.send) begin
handler.data <= xxxx.data;
end
end

then I will try to get the data from the handler which instanced in the monitor. (but I feel it’s not a good way to do that, right ?)

In reply to zz8318:

In the test you are starting simply one or more sequences, in most cases a virtual sequence.
What is your objective sending data upwards in the UVM hierarchy?

In reply to chr_sue:

The DUT will send the data and I have an interface to instance it…
it’s like a simple design and it only has one driver to drive the input of this design and one monitor to receive the output data. I just wonder if any easier way to get the data in the test .

In reply to zz8318:

If you want to use an UVM environment you need a sequencer/driver pair to stimulate your design. A sequence will be executed on the sequencer, generating seq_items which will be processed in the driver, creating the pin wiggles. The test contains your UVMenvironment and specifies which sequence will be executed.
I believe you have a different understanding of test.

In reply to chr_sue:

I have a simple driver and a simple sqr to send item. my question is how to get the data from monitor in the test directly. do you mean we can just use below method to do it ?

in my_test.svh file :

my_env env_inst;
logic data = env_inst.agt_inst.mon_inst.data;

In reply to zz8318:

It is completely unclear to me what you want to do in the test with your data? Dou want to compare something or what?

In reply to chr_sue:

yes, I want to get the data to compare in the test.