# Question regarding check for one feature

**URL:** <https://verificationacademy.com/forums/t/question-regarding-check-for-one-feature/42003>\
**Category:** SystemVerilog\
**Tags:** uvm-checks-monitor, SystemVerilog, assertion, scoreboard, Checkers\
**Created:** [July 26, 2023, 2:28am UTC](https://verificationacademy.com/forums/t/question-regarding-check-for-one-feature/42003 "2023-07-26T02:28:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marathuteja](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/dec6dc/32.png) [@marathuteja](https://verificationacademy.com/forums/u/marathuteja)\
**Post date:** [July 26, 2023, 2:28am UTC](https://verificationacademy.com/forums/t/question-regarding-check-for-one-feature/42003/1 "2023-07-26T02:28:20Z")

</div>

My question is client will send one request to memory, memory has to send response back to client with in 1000 cycles. I have to write a check in such a way that if memory will take more than 1000 cycles I have to rise timeout flag. My doubt is I need to write an assertion or scoreboard check for this kind of checking. I think in assertions it is comparatively easy if I want to write a check in scoreboard I dont have any idea how to proceed further can any one help for this checker.

---

<div class="post-metadata">

**Author:** ![user49](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/user49/32/4533_2.png) [@user49](https://verificationacademy.com/forums/u/user49)\
**Post date:** [July 26, 2023, 4:09am UTC](https://verificationacademy.com/forums/t/question-regarding-check-for-one-feature/42003/2 "2023-07-26T04:09:50Z")

</div>

_In reply to [marathuteja](https://verificationacademy.com/forums/t/question-regarding-check-for-one-feature/42003):_  
Your question seems to be: How do I write an equivalent concurrent SVA assertion in a scoreboard that is a class. Concurrent assertions are illegal in classes.  
I explain this concept in my paper **Understanding the SVA Engine Using the Fork-Join Model** [Verification Horizons](https://verificationacademy.com/verification-horizons/july-2020-volume-16-issue-2) _Using a model, the paper addresses important concepts about attempts and threads. Emphasizes the total independence of attempts._

I came up with a quickly tested model of your requirements using SVA and a class.  
For simplicity, I embedded the class into the module so as to quickly have access to the module variables, and without having to go thru a virtual interface. The latency can be changed to 1000, but for this test, I set it to 5 for simplicity

[Edit code - EDA Playground](https://www.edaplayground.com/x/B8hB) // code  
[EPWave Waveform Viewer](https://www.edaplayground.com/w/x/Wr5) // wave

```verilog

  /* My question is client will send one request to memory, 
  memory has to send response back to client with in 1000 cycles. 
  I have to write a check in such a way that if memory will take more than 1000 cycles 
  I have to rise timeout flag. 
  My doubt is I need to write an assertion or scoreboard check for this kind of checking. 
  I think in assertions it is comparatively easy 
  if I want to write a check in scoreboard I dont have any idea 
  how to proceed further can any one help for this checker. */
      

  module my_module;
  bit clk, req, rdy, acq_flag;
  int pass, fail, latency=5; // 5 instead of 1000 for this test. 
  class c;
  task scoreb(); 
     forever 
       if (req==1) test(); 
       else @(posedge clk);
  endtask
  task test(); 
     int v=latency; 
     while (v>=0) begin 
       @(posedge clk) v=v-1; 
       if(rdy || v<0) break;
     end
     @(posedge clk) assert((acq_flag==1 && v<0) || (acq_flag==0 && v >=0))
     pass=pass+8; else fail=fail+8; ;
  endtask
endclass
  property p_req_rdy; 
    int v_count; 
    @(posedge clk) ($rose(req), v_count=latency) |=> 
       (1, v_count=v_count-1)[*1:$] ##0 ((v_count < 0) || rdy)
    ## 1 (acq_flag && v_count<0) || (!acq_flag && v_count>=0);
  endproperty
  ap_req_rdy: assert property(p_req_rdy) pass=pass+1; else fail=fail+1;

  c c1=new(); 
  initial c1.scoreb(); 

  initial forever #1 clk = !clk;
  initial begin
     $dumpfile("dump.vcd"); $dumpvars; 
     #2 @(posedge clk) req <= 1; @(posedge clk) req<=0; 
     repeat(2) @(posedge clk); rdy <=1; @(posedge clk) rdy <= 0;
     repeat(2) @(posedge clk); 
     #2 $finish;
  end
endmodule

```

Ben Cohen  
[Ben@systemverilog.us](mailto:Ben@systemverilog.us)  
Link to the list of papers and books that I wrote, many are now donated.

> **[Cohen\_Links\_to\_papers\_books.pdf](https://systemverilog.us/vf/Cohen_Links_to_papers_books.pdf)**
>
> 141.16 KB

or [Cohen\_Links\_to\_papers\_books - Google Docs](https://rb.gy/ibks5p)

Getting started with verification with SystemVerilog

> **[Ben Cohen on LinkedIn: Road map to start with verification: SV, SVA , UVM and TB](https://www.linkedin.com/posts/ben-cohen-1172a0_road-map-to-start-with-verification-sv-activity-7050267628208062464-wnzN?utm_source=share&utm_medium=member_desktop)**
>
> Got this question: 
> Q: I need your advice in getting started with verification with systemverilog. I 've built various projects using Verilog and they was…

---

<div class="post-metadata">

**Author:** ![nitin62goel](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/n/dfb087/32.png) [@nitin62goel](https://verificationacademy.com/forums/u/nitin62goel)\
**Post date:** [August 27, 2025, 5:31am UTC](https://verificationacademy.com/forums/t/question-regarding-check-for-one-feature/42003/3 "2025-08-27T05:31:40Z")

</div>

property mem\_write;  
@(posedge clk)  
$rose(req) |=\> strong(mem\_ack[=1] intersect 1[\*1:100]);  
endprperty

---

<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:** [August 28, 2025, 8:27am UTC](https://verificationacademy.com/forums/t/question-regarding-check-for-one-feature/42003/4 "2025-08-28T08:27:38Z")

</div>

@nitin62goel  
Any reason you have used `1[*1:100]` in your consequent ?  
On changing your RHS sequence to 1[\*1000]

```auto
property mem_write;
@(posedge clk) $rose(req) |=> strong(mem_ack[=1] intersect 1[*1000]);
endproperty

```

This meets the requirement that `mem_ack should be asserted within 1000 clocks`  
The assertion would fail in the following scenarios ::  
(1) mem\_ack isn’t asserted even once within 1000 clocks  
(2) mem\_ack is asserted more than once ( non-consecutive / consecutive ) within 1000 clocks  
(3) Simulation ends before 1000 clocks with mem\_ack asserted once or without any mem\_ack asserted

However the original requirement is

```auto
Client will send one request to memory, memory has to send response back to client 
within 1000 cycle.If memory will take more than 1000 cycles I have to rise timeout flag

```

Hence the following scenario is valid :: **‘mem\_ack’ isn’t asserted within 1000 clocks**
