In reply to Prashanthp436:
Read those links in my original reply. For example, get_regfile() is a method for uvm_reg, not uvm_reg_block.
Assume you have the handle top_rm for the top block, of the type uvm_reg_block. Note that this does not have a get_regfile() method - that is for uvm_reg.
Here is an outline of the code - you need to fill in the details including declarations.
top_rm.get_blocks(q); // Get child blocks
foreach (block_q[i]) begin
block_q[i].get_registers(reg_q); // Get all registers in child block
foreach (reg_q[i]) begin
reg_file = reg_q[i].get_regfile();
end
end
Write this code one loop at a time, and run it in debug. You should be able to see the data types returned by each step, and then build the code incrementally. You will get a better understanding of these methods than if someone else writes it.