# How to assert a property is false at every clock cycle?

**URL:** <https://verificationacademy.com/forums/t/how-to-assert-a-property-is-false-at-every-clock-cycle/32433>\
**Category:** SystemVerilog\
**Tags:** assert-property, SystemVerilog, assertion-systemverilog, assertion, systemverilog-assertion-concurrent, SystemVerilogAssertions\
**Created:** [October 18, 2016, 2:47pm UTC](https://verificationacademy.com/forums/t/how-to-assert-a-property-is-false-at-every-clock-cycle/32433 "2016-10-18T14:47:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vineethvs](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/vineethvs/32/1621_2.png) [@vineethvs](https://verificationacademy.com/forums/u/vineethvs)\
**Post date:** [October 18, 2016, 2:47pm UTC](https://verificationacademy.com/forums/t/how-to-assert-a-property-is-false-at-every-clock-cycle/32433/1 "2016-10-18T14:47:16Z")

</div>

Is there a way to **assert** whether a already declared **property** is false at every clock cycle?

For example,

**status[idx]** should be high only if both **req[idx]** and **enable[idx]** is high.

What I would like to have is a negative scenario checker for the above. i.e. the **status** should never go high when either **req** or **enable** is low

I tried below but vcs gives me below compilation error

```verilog
sequence seq_a (int idx);
  !(req[idx] & enable[idx])
endsequence

sequence seq_b (int idx)
  status[idx] == 1
endsequence

property ppty_ab (int idx)
  disable iff (f_req[idx] & f_enable[idx])
  seq_a(idx) |=> seq_b(idx)
endproperty

generate
  for (idx=0; idx<5; idx++) begin
    a_ab : assert property (@(posedge clk) (not ppty_ab(idx)))
           else $display("ppty_ab [%0d] failed at %t",idx,$time)
  end
endgenerate

```

> Error-[PIWDOAACS] Incorrectly used ‘disable iff’  
> Property instances with ‘disable iff’ are only allowed in “assert” “assume” and “cover” statements. Property p\_RiseIntDischeck may not be instantiated in this context.

**seq\_a** and **seq\_b** is already declared and being used for some other assertion. What is the best/recommended way to **reuse** these sequences/properties and create a negative scenario checker for the above case?

---

<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:** [October 18, 2016, 6:17pm UTC](https://verificationacademy.com/forums/t/how-to-assert-a-property-is-false-at-every-clock-cycle/32433/2 "2016-10-18T18:17:24Z")

</div>

_In reply to [vvs3693](https://verificationacademy.com/forums/t/how-to-assert-a-property-is-false-at-every-clock-cycle/32433):_  
In general, assertions should be expressed in a ‘positive’ direction,  
meaning “if trigger\_conditions then expected\_resuls”. Thus, for

```verilog

// the status should never go high @ next cycle when either req or enable is low
ap_reqenb: assert property(
 !req || !enb |=> status==0);  

```

You should also use Binary logical operators (e.g., && ||) instead of Binary bitwise operators (e.g., & | ), as they have different meanings.  
Below is updated code that compiles and elaborates OK. Your code has lots of errors; I am surprised that it compiled.

```verilog

module top; 
	bit clk, a;  
	default clocking @(posedge clk); endclocking
		initial forever #10 clk=!clk; 
		int idx; 
		logic[0:7] req, enable, status, f_enable, f_req; 

		/* Is there a way to assert whether a already declared property is false at every clock cycle?
For example,
status[idx] should be high only if both req[idx] and enable[idx] is high.
What I would like to have is a negative scenario checker for the above. 		
i.e. the status should never go high when either req or enable is low
I tried below but vcs gives me below compilation error*/ 
	sequence seq_a (int idx);
		!(req[idx] & enable[idx]); // !(a&&b) !a || !b
	endsequence
 
	sequence seq_b (int idx);
		status[idx] == 0; // the status should never go high when either req or enable is low 
	endsequence
 
	property ppty_ab (int idx);
		disable iff (f_req[idx] & f_enable[idx])
			seq_a(idx) |=> seq_b(idx);
	endproperty
 
	generate
		for (genvar idx=0; idx<5; idx++) begin
			a_ab : assert property (@(posedge clk) ( ppty_ab(idx)))
			else $display("ppty_ab [%0d] failed at %t",idx,$time);
	   end
	endgenerate	
endmodule 

```

Ben Cohen  
[http://www.systemverilog.us/](http://www.systemverilog.us/) [ben@systemverilog.us](mailto:ben@systemverilog.us)

- [SVA Handbook 4th Edition, 2016 ISBN 978-1518681448](http://goo.gl/JOfuEB)
- 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
- Real Chip Design and Verification Using Verilog and VHDL, 2002 isbn 0-9705394-2-8
- 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

* * *
