Hi all,
I am using the task(read_register),From the bench i am calling parallel from multiple places.And the task is not the automatic type.To avoid the conflict between the two calls i added semaphores to control the access.
Issue : I am observing in my simulations that when task is called parallel one of the address got the key and other is waiting for the key.meanwhile after the first address read again called with another address that got the key instead of getting key to the holding address.Here after done read with new address the address which is holding for key it came out from the task and it is misbehaving.
Ex : File1(seq in UVM) : ------------------------------------ File2(Scoreboard in UVM) :
@(int) --------------------------------------- @(int)
top.read_reg(10); ------------------------------------ top.read_reg(20);
$display("Vamshi") -------------------------------------- top.read_reg(30);
//It is in the Top module
task read_reg(addr,rd_data);
int addr_inp;
$display("before sema addr is %0h",addr);
sema.get(1);
addr_inp =addr;
$display("after sema addr is %0h",addr_inp);
@(posedge clk);
force x.y.addr = addr_inp
..
..
..
sema.put(1);
$display("read done for addr is %0h,data is %0h",addr,rd_data);
endtask
log print from the task :
10ns before sema addr 10
10ns after sema addr 10
10ns before sema addr 20
50ns read done for addr 10 data is 30000
50ns before sema addr 30
50ns after sema addr 30
90ns read done for addr 30 data is 559959
90ns Vamshi → Here it shouldn’t print this message due to it doesn’t got key still
How to avoid this type situation please anybody can help on this.
Thanks,
Vamshi Krishna B