How to compare two dynamic arrays in systemverilog?

i declared an array two dynamic array in monitor for sampling . in scoreboard i have to compare two arrays which i declared in monitor.so how to compare two dynamic arrays?

In reply to nivethitha:

If you have two dynamic arrays, you can write (dyn_array1==dyn_array2). But I’m guessing your problem is more complex that the way your question is worded.

What are the element types in your array? If there are class variables involved, you may need to do a deep-compare of each element. (similar tto the difference between shallow copy and deep copy)

And if this is a UVM testbench, you might want to put the dynamic arrays in a class object where you can share than handles using the uvm_config_db.