//------------------------------------------------------------------------------//// @uvm-contribvirtualclassuvm_cache#(typeKEY_T=int,typeDATA_T=int)extendsuvm_object;// Type: this_type// Typedef representing this cache parameterization.typedefuvm_cache#(KEY_T,DATA_T)this_type;// Type: optional_data// The cache can be queried for data at a given key. If the// key exists within the cache then the data can be returned, but// if the key does ~not~ exist then the cache needs to return// "nothing".//// The ~optional_data~ type is a simple wrapper around a queue// of ~DATA_T~. If the key is found (ie. hit), then the first// (and only) element of the queue stores the value. If the// key is not found (ie. missed), then an empty queue is returned.
endclass:uvm_lru_cache_node// @uvm-contribclassuvm_lru_cache#(typeKEY_T=int,typeDATA_T=int)extendsuvm_cache#(KEY_T,DATA_T);typedefuvm_lru_cache#(KEY_T,DATA_T)this_type;`uvm_object_param_utils(uvm_lru_cache#(KEY_T,DATA_T))`uvm_type_name_decl("uvm_lru_cache")// Function: new// Constructor, initializes the cache.//// The ~max_size~ argument defines the initial maximum size of// the cache. The default ~max_size~ shall be 256.//// A ~max_size~ of 0 indicates that the cache is unsized, and will// not evict any keys.//
// Extends a uvm_lru_cache to add C-side memory management during eviction. //------------------------------------------------------------------------------//classuvm_regex_cacheextendsuvm_lru_cache#(string,chandle);`uvm_type_name_decl("uvm_regex_cache")// Constructor is protected (singleton)protectedfunctionnew(stringname="unnamed-uvm_regex_cache");super.new(name);endfunction:new// Singleton accessorstaticfunctionuvm_regex_cacheget_inst();staticuvm_regex_cachem_inst;if(m_inst==null)m_inst=new("uvm_regex_cache");returnm_inst;endfunction:get_inst