// brings back the register mode to a state before lock_model() so that a subsequent lock_model() can be issued// @uvm-ieee 1800.2-2020 manual 18.1.2.7virtualfunctionvoidunlock_model();bits[uvm_reg_block]=m_roots;m_roots.delete();foreach(blks[blk_])blks[blk_].unlock_model();foreach(regs[rg_])regs[rg_].Xunlock_modelX();m_roots=s;foreach(m_roots[b])m_roots[b]=0;uvm_reg_block::m_reg_block_registry.delete(this.get_full_name());//Clear block pointer cachem_name="";//Clear cached full name
endfunction// @uvm-ieee 1800.2-2020 manual 18.1.2.9virtualtaskwait_for_lock();@m_uvm_lock_model_complete;endtask// Function -- NODOCS -- is_locked//// Return TRUE if the model is locked.// @uvm-ieee 1800.2-2020 manual 18.1.2.10externfunctionbitis_locked();//---------------------// Group -- NODOCS -- Introspection//---------------------
//// If no blocks are found, returns ~null~.externstaticfunctionuvm_reg_blockget_block_by_full_name(stringname);// Function -- NODOCS -- get_map_by_name//// Finds an address map with the specified simple name.//// The name is the simple name of the address map, not a hierarchical name.// relative to this block.// If no map with that name is found in this block, the sub-blocks// are searched for a map of that name and the first one to be found// is returned.//// If no address maps are found, returns ~null~.// @uvm-ieee 1800.2-2020 manual 18.1.3.13
// @uvm-ieee 1800.2-2020 manual 18.1.2.8virtualfunctionvoidset_lock(bitv);locked=v;foreach(blks[idx])blks[idx].set_lock(v);endfunction// remove all knowledge of map m and all regs|mems|vregs contained in m from the block// @uvm-ieee 1800.2-2020 manual 18.1.6.11virtualfunctionvoidunregister(uvm_reg_mapm);foreach(regs[idx])beginif(regs[idx].is_in_map(m))regs.delete(idx);endforeach(mems[idx])beginif(mems[idx].is_in_map(m))mems.delete(idx);endforeach(vregs[idx])beginif(vregs[idx].is_in_map(m))vregs.delete(idx);endmaps.delete(m);endfunction
// lock_modelfunctionvoiduvm_reg_block::lock_model();if(is_locked())return;locked=1;m_name=get_full_name();//Cache the full name of blockm_reg_block_registry[m_name]=this;//Cache this block pointer in full_name registryforeach(regs[rg_])beginregs[rg_].Xlock_modelX();end`ifdefUVM_SPARSE_ARRAYforeach(regarrays[rga_])beginuvm_reg_filerga=rga_;