# UVM scoreboard interview question

**URL:** <https://verificationacademy.com/forums/t/uvm-scoreboard-interview-question/49823>\
**Category:** UVM\
**Tags:** UVM-scoreboard, UVM\
**Created:** [March 12, 2025, 6:13pm UTC](https://verificationacademy.com/forums/t/uvm-scoreboard-interview-question/49823 "2025-03-12T18:13:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sabrin](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/59ef9b/32.png) [@sabrin](https://verificationacademy.com/forums/u/sabrin)\
**Post date:** [March 12, 2025, 6:13pm UTC](https://verificationacademy.com/forums/t/uvm-scoreboard-interview-question/49823/1 "2025-03-12T18:13:53Z")

</div>

Hi everyone, I’m currently interviewing for DV role at entry level and I was asked below question in one of my interview. I dont have much experience in writing SB so I could not answer the question.

Suppose we have a stream of data bits coming in with START bit and END bit. You need to write a logic to find max value of sum of 3 bits from the stream.

For example: start\_bit-\> 1-1-2-2-3-3-4-1-\>end  
sum of 1st 3 bits = 1+1+2=4.  
then it will move to next position so next sum of 3 bits,  
2nd sum = 1+2+2 = 5  
3rd sum = 2+2+3=7.  
4th sum = 2+3+3 = 8  
5th sum = 3+3+4 = 10  
6th sum= 3+4+1 = 8  
So the max will be 10.

Write a SB run\_phase logic for this condition.

Can anyone please guide me how to solve/answer this question?

---

<div class="post-metadata">

**Author:** ![whizclips](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/whizclips/32/2813_2.png) [@whizclips](https://verificationacademy.com/forums/u/whizclips)\
**Post date:** [March 15, 2025, 5:51pm UTC](https://verificationacademy.com/forums/t/uvm-scoreboard-interview-question/49823/2 "2025-03-15T17:51:59Z")

</div>

One way to do that can be -

```auto
class my_scb extends uvm_scoreboard;
  `uvm_component_utils(my_scb)
  
  uvm_analysis_imp(my_txn, my_scb) imp_mon;
  bit start_detect;
  bit end_detect;
  local mailbox (my_txn) mbx;
  int data_q [$];
  
  function new(string name = "my_scb", uvm_component parent);
    super.new(name, parent);
    imp_mon = new("imp_mon",this);
    mbx = new();
  endfunction'
  
  function void write(my_txn txn);
    mbx.put(txn);
  endfunction
  
  task run_phase(uvm_phase phase);
    my_txn txn;
    phase.raise_objection(this);
    forever 
      begin
        mbx.get(txn);
        if(txn.start)
          begin
            start_detect = 1;
            data_q.delete();
          end
        if(txn.done)
          begin
            if(start_detect)
              begin
                start_detect =0;
            	end_detect = 1;      
            	max_sum(data_q);
              end
          end
        else if(start_detect)
          begin
            data_q.push_back(txn.data);
          end
      end
    phase.drop_objection(this);
  endtask
  
  function void max_sum(int data_q[$]);
    bit [123:0] max_val;
    bit [123:0] tem_val;
    if(data_q.size() < 3) begin
      `uvm_error("FAIL SUM","not enough data to calculate sum")
    end
    
    else begin 
      for (int i = 0; i <= data_q.size() - 3; i++) begin
        tem_val = data_q[i] + data_q[i+1] + data_q[i+1];
        if(tem_val > max_val) begin
          max_val = tem_val;
        end
  endfunction
endclass

```

---

<div class="post-metadata">

**Author:** ![Have\_A\_Doubt](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@Have\_A\_Doubt](https://verificationacademy.com/forums/u/Have_A_Doubt)\
**Post date:** [March 16, 2025, 12:05am UTC](https://verificationacademy.com/forums/t/uvm-scoreboard-interview-question/49823/3 "2025-03-16T00:05:55Z")

</div>

@whizclips  
I believe you would run into Tb Timeout issue due to never dropping objection

```auto
task run_phase(uvm_phase phase);
    my_txn txn;
    
    forever 
      begin
        mbx.get(txn);
        phase.raise_objection(this); // Raise objection only on fetching a transaction
        if(txn.start)
          begin
            start_detect = 1;
            data_q.delete();
          end
        if(txn.done)
          begin
            if(start_detect)
              begin
                start_detect =0;
            	end_detect = 1;      
            	max_sum(data_q);
              end
          end
        else if(start_detect)
          begin
            data_q.push_back(txn.data);
          end
         phase.drop_objection(this); // Drop objection post processing the fetched transaction
      end
  endtask

```

---

<div class="post-metadata">

**Author:** ![whizclips](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/whizclips/32/2813_2.png) [@whizclips](https://verificationacademy.com/forums/u/whizclips)\
**Post date:** [March 16, 2025, 3:26pm UTC](https://verificationacademy.com/forums/t/uvm-scoreboard-interview-question/49823/4 "2025-03-16T15:26:01Z")

</div>

Correct! Thanks for the correction

---

<div class="post-metadata">

**Author:** ![milo1](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/d6d6ee/32.png) [@milo1](https://verificationacademy.com/forums/u/milo1)\
**Post date:** [February 12, 2026, 9:57am UTC](https://verificationacademy.com/forums/t/uvm-scoreboard-interview-question/49823/5 "2026-02-12T09:57:53Z")

</div>

Why should be there an objection in SB anyway?

High probability to get the simulation into a deadlock, as test level have raised an objection

> [@Using raise and drop objection in scoreboard](https://verificationacademy.com/forums/t/using-raise-and-drop-objection-in-scoreboard/34264):
>
> Hi, Is that adviced use raise objection and drop objection in scoreboard, instead of using set\_drain\_time in the testcase.

> **[UVM Objection and best end of test practices](https://www.linkedin.com/pulse/uvm-objection-best-end-test-practices-ajazul-haque-kxdgf)**
>
> What Do UVM Objections Do? Control Phases: UVM uses a phase mechanism (e.g.
