qwerty Posted July 24, 2014 Report Share Posted July 24, 2014 Hi, How can i get the access policy of a register? For fields its possible to get using get_access(). Is their a way to extract the "Registers" from the model with RW access policy ? Thanks. Quote Link to comment Share on other sites More sharing options...
tudor.timi Posted July 24, 2014 Report Share Posted July 24, 2014 A register doesn't have an access policy per se. It can have a certain level of access rights inside an address map. To get this, you have to use the get_reg_map_info(...) method of uvm_reg_map. Be aware that this method isn't part of the standard (the reference guide), but it is public inside the class (if you care about such things). Here's a snippet (not tested): uvm_reg_map_info info = my_map.get_reg_map_info(my_reg); $display("Access rights for my_reg in my_map are ", info.rights); Quote Link to comment Share on other sites More sharing options...
uwes Posted July 25, 2014 Report Share Posted July 25, 2014 hi, registers are rather "dumb" containers of register fields and there might not be a single access policy for a register. fields (uvm_reg_fields) carry most of the functionality in UVM_REG. in order to learn the access policy of the field you can query via somefield.get_access(map). since the effective access policy depends upon the uvm_reg_map used for a potential access you may pass the relevant map into the function as well. /uwe Quote Link to comment Share on other sites More sharing options...
qwerty Posted July 28, 2014 Author Report Share Posted July 28, 2014 Thanks tudor, that is a nice way to get the access policy of registers if all the fields have same access policy. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.