# Is it necessary for comparison of data in scoreboard we should use check\_phase?

**URL:** <https://verificationacademy.com/forums/t/is-it-necessary-for-comparison-of-data-in-scoreboard-we-should-use-check-phase/34243>\
**Category:** UVM\
**Tags:** run\_phase, uvm\_scoreboard, UVM, check\_phase\
**Created:** [March 23, 2018, 6:54am UTC](https://verificationacademy.com/forums/t/is-it-necessary-for-comparison-of-data-in-scoreboard-we-should-use-check-phase/34243 "2018-03-23T06:54:22Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Subhra\_Bera](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/subhra_bera/32/3838_2.png) [@Subhra\_Bera](https://verificationacademy.com/forums/u/Subhra_Bera)\
**Post date:** [March 23, 2018, 6:01pm UTC](https://verificationacademy.com/forums/t/is-it-necessary-for-comparison-of-data-in-scoreboard-we-should-use-check-phase/34243/4 "2018-03-23T18:01:13Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/is-it-necessary-for-comparison-of-data-in-scoreboard-we-should-use-check-phase/34243/3):_  
Yes I tried case equality but they did not work. Actually I am writing scoreboard logic for SPI. I have taken a queue of apb(master) sequence item in scoreboard. And another queue of SPI sequence item. I have taken an associative array in scoreboard for mimicking the DUT model.  
I am poping out data from apb\_queue and based on address(apb sequence item) I am storing the the data in the associative array. Then when spi\_queue is getting its first data. Then I am comparing based on the character length.  
SPI DUT has Tx0,Tx1,Tx2,Tx3,Rx0,Rx1,Rx2,Rx3,ctrl,divider,ss register. All are 32bit in size. There address are 00,04,08,0c,10,14,18 in hexadecimal(Tx and Rx registers address are same).ctrl[6:0] is the length of the character to be send and received.  
when I am taking logic[31:0] char\_len variable in scoreboard. In this variable I am storing associative\_array[ctrl\_addr]. And based on char\_len[6:0](character length) I am comparing.  
I have taken logic[127:0]Total\_tx variable. And storing like Total\_tx={Tx3,Tx2,Tx1,Tx0}; and then based on char\_len[6:0] I am comparing. like

```verilog
 for(int i=0;i<char_len;i++) begin
                           if(Total_tx[i]==MOSI[i]) (Mosi is the spi slave sequence item 
                          k++; data of 128 bit length logic type 
                       else variable)
                        break; 
                   end  

```

and then if k==char\_lenth then data matches.  
But Tx\_Total=10203040102030401020304010203040;  
MOSI= XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX40(30 X, 2 DIGIT)  
CHAR\_LEN =8 BUT data is not matching.

---

_[View the full topic](https://verificationacademy.com/forums/t/is-it-necessary-for-comparison-of-data-in-scoreboard-we-should-use-check-phase/34243)._
