Jump to content
nayan

How to read all the register in RAL model using reg_map?

Recommended Posts

I have multiple registers in my design blk0 for which i have created a RAL model?

How to read all the register in RAL model using reg_map?

Please explain with example...

 

Share this post


Link to post
Share on other sites
On 4/8/2019 at 12:14 PM, nayan said:

I have multiple registers in my design blk0 for which i have created a RAL model?

How to read all the register in RAL model using reg_map?

Please explain with example...

 

Hi
Following code may helpful to you.

 // Declaration
 uvm_reg_map   maps[$];
 uvm_reg       regs[$];
 uvm_status_e  status;
 
 // Getting number of maps associated with block handle
 blk.get_maps(maps);
 foreach(maps[d])
 begin
     regs.delete();
     // Getting associated total registers with map
     maps[d].get_registers(regs);
     foreach(regs[k])
     begin
       regs[k].read(status, rd_val, maps[d]);
       // Do necessary operation based on read value
     end
 end

Regards,
Mitesh Patel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×