In reply to dave_59:
I have 32 ports and each port has defined space in memory into which I need to write certain descriptors.
Class A has the variables and descriptors per port and I’m parametrizing the class with the start addr of each port.My idea is,by taking objects of this class ,I can mimck the same behavior for all the ports.
In the function func1, I want to take the value of one descriptor and generate another descriptor for the same port and write it into the corresponding ports’ space in memory
class B_seq extends uvm_sequence;
A a1;
A a2
A a3;
task body()
.....
if(port==1)
func1(i,a1);
else if(port ==2)
func1(i,a2);
else
func1(i,a3);
endtask;
function func1(int i,A this_a);
bit[31:0] cnt;
cnt=this_a.hdr[127:96];
......
backdoor_write_to_mem(this_a.cnt_addr,cnt);
endfunction
endclass
Dave,
with your idea,I should cast the received object into corresponding ports’ object.Please correct me if I’m wrong.