# Delaying the start of scoreboard

**URL:** <https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779>\
**Category:** UVM\
**Tags:** UVM, uvm-scorebaord\
**Created:** [February 23, 2019, 2:27pm UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779 "2019-02-23T14:27:38Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suresh\_R](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@Suresh\_R](https://verificationacademy.com/forums/u/Suresh_R)\
**Post date:** [February 23, 2019, 2:27pm UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/1 "2019-02-23T14:27:38Z")

</div>

I am trying to make APB VIP.

However I am stuck at scoreboard-  
The idea is to delay the scoreboard start until the monitor has sent all the transactions (5 writes, 5 reads) to Scoreboard.  
I tried the #Delay method in run phase and it’s working fine but I want something which can be true for every test.

Is there a way to check the last transaction in sequence or monitor and then trigger an event from there to start the scoreboard ?

Thanks,  
SR

**MONITOR:**

```verilog

task run_phase(uvm_phase phase);
	apb_transaction apb_tx_mon;

forever begin
	apb_tx_mon = apb_transaction::type_id::create("apb_tx_mon", this);

	@(posedge apb_vin.clk)
	begin
			 
		if (apb_vin.penable)
		
		begin
			apb_tx_mon.paddr = apb_vin.paddr;
			apb_tx_mon.pwdata	= apb_vin.pwdata;
			apb_tx_mon.pwrite	= apb_vin.pwrite;
			if (!apb_vin.pwrite) begin
		#1;	apb_tx_mon.prdata	= apb_vin.prdata;
		
		end
			`uvm_info("MONITOR", "CALLING WRITE METHOD", UVM_MEDIUM);
			apb_mon_ap.write(apb_tx_mon);
				
	end
	end
end

```

**SCOREBOARD:**

```verilog

task run();
#420;
	int i;
	i= sb_fifo.used();
	
	while(sb_fifo.used() != 0) 
begin
	`uvm_info("SCOREBOARD", $sformatf("fifo size: %0d ", sb_fifo.used()), UVM_MEDIUM);	
	sb_fifo.get(apb_tx);

	
	//`uvm_info("SCOREBOARD_PRINT", $sformatf("paddr=%0d, prdata=%0d, pwdata=%0d, pwrite=%0d", apb_tx.paddr, apb_tx.prdata, apb_tx.pwdata, apb_tx.pwrite), UVM_MEDIUM);
		if (!apb_tx.pwrite)
		begin

		`uvm_info("SCOREBOARD", $sformatf("pwrite= %0d", apb_tx.pwrite ), UVM_MEDIUM);
		compare(apb_tx);
		
		end
		else 
			write_box.put(apb_tx);
	end

endtask

```

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [February 24, 2019, 7:42am UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/2 "2019-02-24T07:42:08Z")

</div>

_In reply to [Suresh\_R](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779):_

Using absolute time in a TLM component is useless. The starting point of your scoreboard is the trigger event.

Could you please explain what apb\_tx.pwrite is?

I believe your problem is somewhere else.

---

<div class="post-metadata">

**Author:** ![Suresh\_R](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@Suresh\_R](https://verificationacademy.com/forums/u/Suresh_R)\
**Post date:** [February 24, 2019, 7:55am UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/3 "2019-02-24T07:55:56Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/2):_

apb\_tx.pwrite is simply a read/write signal.  
apb\_tx.pwrite = 1 //Write  
apb\_tx.pwrite = 0 //Read

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [February 24, 2019, 11:44am UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/4 "2019-02-24T11:44:57Z")

</div>

_In reply to [Suresh\_R](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/3):_

> _In reply to [chr\_sue](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/3):_  
> apb\_tx.pwrite is simply a read/write signal.  
> apb\_tx.pwrite = 1 //Write  
> apb\_tx.pwrite = 0 //Read

And what are you compairing? You can compare 2 items, but you have only one. Using the compare method of the seq\_item you hae to call this on an item like this:

```verilog
item1.compare(item2);

```

compares item1 against item2.

---

<div class="post-metadata">

**Author:** ![Suresh\_R](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@Suresh\_R](https://verificationacademy.com/forums/u/Suresh_R)\
**Post date:** [February 24, 2019, 12:00pm UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/5 "2019-02-24T12:00:20Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/4):_

The write transaction (data and addr) are stored in mailbox. Compare task is called whenever a read transaction happens to compare with the mailbox data.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [February 24, 2019, 12:22pm UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/6 "2019-02-24T12:22:48Z")

</div>

_In reply to [Suresh\_R](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/5):_

This was not my question. I believe your syntax is wrong.

---

<div class="post-metadata">

**Author:** ![Suresh\_R](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@Suresh\_R](https://verificationacademy.com/forums/u/Suresh_R)\
**Post date:** [February 24, 2019, 4:21pm UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/7 "2019-02-24T16:21:26Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/6):_

I have defined a task named compare(). As I have mentioned earlier, the scoreboard is working perfectly fine with the #420 delay. But I want something concrete which works for every test.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [February 24, 2019, 4:41pm UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/8 "2019-02-24T16:41:40Z")

</div>

_In reply to [Suresh\_R](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/7):_

OK, where do you trigger your event, you are waiting for in the scoreboard?

---

<div class="post-metadata">

**Author:** ![Suresh\_R](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@Suresh\_R](https://verificationacademy.com/forums/u/Suresh_R)\
**Post date:** [February 24, 2019, 4:58pm UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/9 "2019-02-24T16:58:41Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/8):_

Not actually triggering. That was mistakenly pasted when I was planning to trigger it from monitor. I have edited the question to remove the wrong part.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [February 24, 2019, 6:47pm UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/10 "2019-02-24T18:47:28Z")

</div>

_In reply to [Suresh\_R](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/9):_

I do not understand what the benefit is to make the compare after all transactions have been executed. But currently you are retrieving each single transaction from the sb\_fifo.  
You have a wrong condition in your while loop.  
Your objective is to store all transactions first before doing the compare. Just modify your code to reach this objective, i.e. count the number of the transactions you received from the monitor. And then do the compare for each transaction pair.  
To be honest, it is not a good idea to do this because you are burning your computer resources and slowing down the simulation. Compairing on the fly as the transactions arrive is the real solution.

---

<div class="post-metadata">

**Author:** ![Suresh\_R](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@Suresh\_R](https://verificationacademy.com/forums/u/Suresh_R)\
**Post date:** [February 25, 2019, 3:28am UTC](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/11 "2019-02-25T03:28:18Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/delaying-the-start-of-scoreboard/35779/10):_

I cannot compare on the fly as the transactions arrive. I have to wait for read transactions. I am doing 5 writes and then 5 reads from the same addresses.

To minimize the damage I am not saving the read transactions - the while condition does that for me. It compares as soon as a read transaction arrives.
