# Loop for the properties for dynamic signals in the interface

**URL:** <https://verificationacademy.com/forums/t/loop-for-the-properties-for-dynamic-signals-in-the-interface/34315>\
**Category:** SystemVerilog\
**Tags:** Bus-interface, SystemVerilog, property, cover-property, for-loop\
**Created:** [April 6, 2018, 6:17pm UTC](https://verificationacademy.com/forums/t/loop-for-the-properties-for-dynamic-signals-in-the-interface/34315 "2018-04-06T18:17:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MohammedWasimMaster](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@MohammedWasimMaster](https://verificationacademy.com/forums/u/MohammedWasimMaster)\
**Post date:** [April 6, 2018, 6:17pm UTC](https://verificationacademy.com/forums/t/loop-for-the-properties-for-dynamic-signals-in-the-interface/34315/1 "2018-04-06T18:17:36Z")

</div>

Hi,

Limitations:

1. If, inside interface I have parameter(for number of signals req/ack) below code works well(but I have limitation and don’t have parameter inside my interface where I have written property).

```verilog
generate for (genvar i=0; i<PARAM_VALUE; i++) begin : NUMBER
req_with_ack : cover property
(@(posedge clk) disable iff (!reset)
$rose(req[i]) |-> $rose (ack[i]);
end
endgenerate

```

1. If, req/ack number of signals are static and known in the interface, I could have hard coded as below, which works well(but that is a limitation, I have dynamic number of req/ack):  
//per req/ack pair can be written as below , use with for/generate

```verilog
 property req_ack_0;
@(posedge clk) disable iff (!reset)
$rose(req[0]) |-> $rose(ack[0]) ;
endproperty
req_ack_0: cover property(req_ack_0);

```

So bottom line is inside interface in the beginning I dont have parameter/known value of req/ack signals, but I have runtime class config field value available in the interface to decide and write property with loop may be.

Details:

1. I have number of req and relevant ack signals for them(but in the simulation they are dynamic in numbers, it can be 1 to 10).
2. I want to write property to see all req and ack have occurred during a simulation(for a particular simulation lets assume total req/ack pair is 5 , then I need five properties to be covered as shown above).

```verilog
$rose(req[0]) |-> $rose(ack[0]) ;
$rose(req[1]) |-> $rose(ack[1]) ;
$rose(req[2]) |-> $rose(ack[2]) ;
$rose(req[3]) |-> $rose(ack[3]) ;
$rose(req[4]) |-> $rose(ack[4]) ;

```

1. Inside interface I don’t have parameter initially available to decide how many number of req/ack are available.
2. Number of req and relevant ack signals are dynamic and decided run time(after build\_phase) by class configuration field.
3. Now the problem is I don’t have parameter available in the interface but I have class configuration field value after build phase of UVM and now I dont know how to write a loop for above property (I have access of class config field in the interface), anyone have any idea how this can be achieved?

Inside interface, I also tried below but did not work:

```verilog
property req_with_ack(logic req, logic ack);
  @(posedge clk) disable iff (!reset)
  $rose(req) |-> $rose(ack) > 0));
endproperty

always @(posedge clk) begin
  for (int i=0; i > class.config.req_ack_config;i++) begin
    req_with_ack_num[i] : cover property (req_with_ack(.req[i],.ack[i]));
  end 
end

```

Thank you.

---

<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:** [April 7, 2018, 8:37pm UTC](https://verificationacademy.com/forums/t/loop-for-the-properties-for-dynamic-signals-in-the-interface/34315/2 "2018-04-07T20:37:42Z")

</div>

_In reply to [megamind](https://verificationacademy.com/forums/t/loop-for-the-properties-for-dynamic-signals-in-the-interface/34315):_

See [properties for multiple signals(or array of signals) in the interface | Verification Academy](https://verificationacademy.com/forums/systemverilog/properties-multiple-signalsor-array-signals-interface)

Ben Cohen  
[http://www.systemverilog.us/](http://www.systemverilog.us/) [ben@systemverilog.us](mailto:ben@systemverilog.us)  
For training, consulting, services: contact [Home - My cvcblr](http://cvcblr.com/home)

- [SVA Handbook 4th Edition, 2016 ISBN 978-1518681448](http://goo.gl/JOfuEB)
- [Real Chip Design and Verification Using Verilog and VHDL, 2002 isbn 978-1539769712](https://goo.gl/d10QHh)
- A Pragmatic Approach to VMM Adoption 2006 ISBN 0-9705394-9-5
- Using PSL/SUGAR for Formal and Dynamic Verification 2nd Edition, 2004, ISBN 0-9705394-6-0
- Component Design by Example ", 2001 ISBN 0-9705394-0-1
- VHDL Coding Styles and Methodologies, 2nd Edition, 1999 ISBN 0-7923-8474-1
- VHDL Answers to Frequently Asked Questions, 2nd Edition ISBN 0-7923-8115

* * *

See Paper: [VF Horizons:PAPER: SVA Alternative for Complex Assertions | Verification Academy](https://verificationacademy.com/forums/systemverilog/vf-horizonspaper-sva-alternative-complex-assertions)

---

<div class="post-metadata">

**Author:** ![MohammedWasimMaster](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@MohammedWasimMaster](https://verificationacademy.com/forums/u/MohammedWasimMaster)\
**Post date:** [April 9, 2018, 10:18pm UTC](https://verificationacademy.com/forums/t/loop-for-the-properties-for-dynamic-signals-in-the-interface/34315/3 "2018-04-09T22:18:35Z")

</div>

_In reply to [ben@SystemVerilog.us](https://verificationacademy.com/forums/t/loop-for-the-properties-for-dynamic-signals-in-the-interface/34315/2):_

Thank you, this helped to understand.
