Hi,
I’m trying to create an object which is constructed from array of uvm_queue. The idea is that each item in the array is for itself a uvm_queue ( i.e. a list of items).
The problem is I can’t manage to iterate the items of a single ‘memory ID’ list.
When I compile I get the following Error:
*if (ml_mem_array[mem_id][ii].m_addr == a_addr)
|
xmelab: E,CUVNAA (./utils.sv,47|45): An index has been applied to an inappropriate type.
The code looks like this:
// ============================================================================
class mem_entry extends uvm_object;
int m_addr;
int m_data;
…
endclass
// =============================================================================
class memory extends uvm_object;
uvm_queue#(mem_entry) ml_mem_array[2];
function new (string name = "memory");
super.new(name);
endfunction
function mem_entry get_mem_entry(int a_addr, int mem_id);
int v_size;
int ii;
v_size = ml_mem_array[mem_id].size();
if ((mem_id >= 2) || (v_size == 0))
return null;
for (ii=0 ; ii<=(v_size-1) ; ii=ii+1)
begin
if (ml_mem_array[mem_id][ii].m_addr == a_addr)
return ml_mem_array[mem_id][ii];
end
return null;
endfunction
endclass