# Need help writing Systemverilog assertion (SVA) with req, busy, gnt 

**URL:** <https://verificationacademy.com/forums/t/need-help-writing-systemverilog-assertion-sva-with-req-busy-gnt/51755>\
**Category:** SystemVerilog\
**Tags:** SVA-Assertion, SystemVerilog\
**Created:** [September 30, 2026, 1:05pm UTC](https://verificationacademy.com/forums/t/need-help-writing-systemverilog-assertion-sva-with-req-busy-gnt/51755 "2026-09-30T13:05:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aa\_gate](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/aa_gate/32/4459_2.png) [@aa\_gate](https://verificationacademy.com/forums/u/aa_gate)\
**Post date:** [September 30, 2026, 1:05pm UTC](https://verificationacademy.com/forums/t/need-help-writing-systemverilog-assertion-sva-with-req-busy-gnt/51755/1 "2026-09-30T13:05:37Z")

</div>

### The DUT spec

A simple request/grant arbiter interface. All signals synchronous to `clk`, async active-low `rst_n`.

```auto
interface arb_if (input bit clk, input bit rst_n);
logic req; // requester asserts, holds until granted
logic gnt; // arbiter grants for exactly one cycle
logic [31:0] addr; // valid with req
logic busy; // arbiter cannot grant while high
logic err; // error pulse
logic [1:0] state; // 0=IDLE 1=ARB 2=GRANT 3=ERR
endinterface

```

I need to write one single assertion that covers both requirements-  
Req1 - Every `req` gets a `gnt` within 1 to 5 cycles.  
Req2 -`gnt` must never assert while `busy` is high. So if `busy` is high when `req` arrives, gnt shouldnt be asserted until `busy` drops.

---

<div class="post-metadata">

**Author:** ![AGS91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/f475e1/32.png) [@AGS91](https://verificationacademy.com/forums/u/AGS91)\
**Post date:** [September 30, 2026, 3:26pm UTC](https://verificationacademy.com/forums/t/need-help-writing-systemverilog-assertion-sva-with-req-busy-gnt/51755/2 "2026-09-30T15:26:59Z")

</div>

> [@aa\_gate](#):
>
> ### The DUT spec
> 
> Req2 -`gnt` must never assert while `busy` is high. Then: if `busy` is high when `req` arrives, **the above shouldn’t apply until `busy` drops.**

Please elaborate on " **the above shouldn’t apply until `busy` drops"**

For Req1 you could simply write

```auto
property req1;
 @(posedge clk) $rose(req) |-> ##[1:5] $rose(gnt);
endproperty

```

(1) It assumes that if `gnt` is asserted before `req` is asserted then the grant would be ignored.

(2) If `gnt`if asserted on same clock as `req` and it’s de-asserted at next clock then the grant goes unnoticed

---

<div class="post-metadata">

**Author:** ![aa\_gate](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/aa_gate/32/4459_2.png) [@aa\_gate](https://verificationacademy.com/forums/u/aa_gate)\
**Post date:** [September 30, 2026, 9:55pm UTC](https://verificationacademy.com/forums/t/need-help-writing-systemverilog-assertion-sva-with-req-busy-gnt/51755/3 "2026-09-30T21:55:34Z")

</div>

I modified the question!

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [October 1, 2026, 2:34am UTC](https://verificationacademy.com/forums/t/need-help-writing-systemverilog-assertion-sva-with-req-busy-gnt/51755/4 "2026-10-01T02:34:34Z")

</div>

I see three requirements, hence three assertions.

1. `req` must hold until `gnt`
2. `gnt` must never be asserted while `busy` is high
3. `gnt` must be asserted for 1 cycle within 5 cycles of `req` and not `busy`

```auto
Req1: assert property (@(posedge clk)
  req |-> req until_with gnt
);
Req2: assert property (@(posedge clk)
  !(gnt && busy)
);
Req3: assert property (@(posedge clk iff !busy)
  $rose(req) |-> ##[1:5] (gnt ##1 !gnt)
);

```

---

<div class="post-metadata">

**Author:** ![AGS91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/f475e1/32.png) [@AGS91](https://verificationacademy.com/forums/u/AGS91)\
**Post date:** [October 1, 2026, 5:39am UTC](https://verificationacademy.com/forums/t/need-help-writing-systemverilog-assertion-sva-with-req-busy-gnt/51755/5 "2026-10-01T05:39:12Z")

</div>

Hi Dave,

> [@dave\_59](#):
>
> I see three requirements, hence three assertions.
> 
> 1. `req` must hold until `gnt`

Is this required ? It’s possible that `req` is asserted more than once ( 1st assertion → deasserted → 2nd assertion ) before the 1st `gnt` is asserted within 5 clocks of the 1st `req`

If the intention is to have a unique grant for each request, I believe Ben has a separate thread discussing this.

---

<div class="post-metadata">

**Author:** ![aa\_gate](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/aa_gate/32/4459_2.png) [@aa\_gate](https://verificationacademy.com/forums/u/aa_gate)\
**Post date:** [October 1, 2026, 2:03pm UTC](https://verificationacademy.com/forums/t/need-help-writing-systemverilog-assertion-sva-with-req-busy-gnt/51755/6 "2026-10-01T14:03:10Z")

</div>

> [@dave\_59](#):
>
> `gnt`

the requirement mentions that req should stay asserted until gnt

---

<div class="post-metadata">

**Author:** ![aa\_gate](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/aa_gate/32/4459_2.png) [@aa\_gate](https://verificationacademy.com/forums/u/aa_gate)\
**Post date:** [October 1, 2026, 2:05pm UTC](https://verificationacademy.com/forums/t/need-help-writing-systemverilog-assertion-sva-with-req-busy-gnt/51755/7 "2026-10-01T14:05:45Z")

</div>

Thanks Dave! but is it possible to write this into a single assertion?

---

<div class="post-metadata">

**Author:** ![AGS91](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/f475e1/32.png) [@AGS91](https://verificationacademy.com/forums/u/AGS91)\
**Post date:** [October 1, 2026, 2:19pm UTC](https://verificationacademy.com/forums/t/need-help-writing-systemverilog-assertion-sva-with-req-busy-gnt/51755/8 "2026-10-01T14:19:50Z")

</div>

> [@aa\_gate](#):
>
> the requirement mentions that req should stay asserted until gnt

Oh I see that you have mentioned it as part of the comment

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [October 1, 2026, 5:41pm UTC](https://verificationacademy.com/forums/t/need-help-writing-systemverilog-assertion-sva-with-req-busy-gnt/51755/9 "2026-10-01T17:41:49Z")

</div>

Keeping them as three separate assertions is usually easier to debug: each failure points to a specific requirement.

It’s easy to combine `Req1` and `Req2` into one assertion by `and`’ing the properties together. The third is a little harder because you’d have to create a local variable counter.

```auto
property Req1;
  req |-> req until_with gnt;
endproperty

property Req2;
  !(gnt && busy);
endproperty

property Req3;
  int n;
  ($rose(req) && !busy, n = 0) |=>
  ((busy || !gnt && n< 4), n = n + (!busy && !gnt))[*0:$]
  ##1 (gnt && !busy && n <= 4) ##1 !gnt;
endproperty

assert property ( @(posedge clk) Req1 and Req2 and Req3; );

```
