How to compare different types of transactions in Scoreboard?

I have created 2 analysis_imports in the scoreboard to receive Type_A and Type_B transactions.
There is only one particular field say(bit [31:0] w_data) which is common between the 2 types of transaction.

1st Method: Got a different PacketA.

In the write function of Type_A …I collected the PacketA say with address 16’h1000 in a queue of Type_A.
Then tried to pop it and compare in the Write function of Type_B. But I got a different packet from the queue (executed at the current time), not the one with the address 16’h1000.

2nd Method: Works
In Type_A write function I collect the PacketA and store the w_data of Type_A in a temp variable.
I use this temp in the Type_B write function to compare with the Received Packetb.w_data.

Is there a better way of comparing?

In reply to Curious_cat:
You are talking about tarnsactions and packets. How do they look like and what are the differences? How is the relationship to the addr?.

In reply to chr_sue:

In reply to Curious_cat:
You are talking about tarnsactions and packets. How do they look like and what are the differences? How is the relationship to the addr?.

PacketA is transaction item of Type_A Transaction
PacketB is transaction item of Type_B Transaction

PacketA is sent as input to the DUT.
The DUT processes the info of PacketA and forms PacketB.

w_data is a field which is common to both PacketA and PacketB.
addr is a field of PacketA, it just used a condition to filter packets of TypeA and compare w_data with PacketB.

In reply to Curious_cat:

You cannot compare transactions of different types directly. The intention is you have a TLM reference model which converts your input transaction to a transaction of the output type. But you can try to comapre singeld data fields of different transaction. In your case you have to consider 2 differnt types of dat, i.e. addr and data. Doing this you could store your data in corresponding associative arrays using the addr as a key/index.

In reply to chr_sue:

In reply to Curious_cat:
You cannot compare transactions of different types directly. The intention is you have a TLM reference model which converts your input transaction to a transaction of the output type. But you can try to comapre singeld data fields of different transaction. In your case you have to consider 2 differnt types of dat, i.e. addr and data. Doing this you could store your data in corresponding associative arrays using the addr as a key/index.

Yes , storing in associative array helps…
Thank you.