Hi!
I’m exploring the functionalities of the uvm_reg and uvm_reg_field classes and I ran into something strange when I was using the get_access() method of uvm_reg_field: With this following code snippet
uvm_reg rg;
uvm_reg_map maps[$];
rg.get_maps(maps);
string access_str = "|";
uvm_reg_field fields[$];
rg.get_fields(fields);
foreach(fields[j]) begin
access_str = {access_str, {fields[j].get_access(), "|"}};
end
the fields appear to sometimes have their access property changed. I have so far only seen this happen with “WO” being changed into “WO|”. I should mention that at no point in the code do I use the set_access() method.
If I modify the code in the following way
uvm_reg rg;
uvm_reg_map maps[$];
rg.get_maps(maps);
string access_str = "|";
string get_access_ret; // Added line
uvm_reg_field fields[$];
rg.get_fields(fields);
foreach(fields[j]) begin
get_access_ret = fields[j].get_access(); // Added line
access_str = {access_str, {get_access_ret, "|"}}; // Modified line
end
the problem resolves itself. Does anyone understand what might be happening here?
Thanks in advance for any help!
-------------------------------------Footnote------------------------------------------------
If anyone is curious what I’m trying to do: I’m trying to concatenate the access type strings into one string and get something like this:
|RW|RW|RW|RW|RW| or |RO|RO|RW|RW|RW| etc. My intention was to have it display in the simulation log at UVM_MEDIUM levels of verbosity.