# Assertions to check parameters

**URL:** <https://verificationacademy.com/forums/t/assertions-to-check-parameters/32878>\
**Category:** SystemVerilog\
**Tags:** SVA, system-verilog-assertion, SystemVerilog\
**Created:** [February 18, 2017, 10:23pm UTC](https://verificationacademy.com/forums/t/assertions-to-check-parameters/32878 "2017-02-18T22:23:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [February 18, 2017, 11:38pm UTC](https://verificationacademy.com/forums/t/assertions-to-check-parameters/32878/2 "2017-02-18T23:38:58Z")

</div>

_In reply to [svishnu](https://verificationacademy.com/forums/t/assertions-to-check-parameters/32878):_

> I have two top level parameters in my module WIDTH and HEIGHT.  
> The use case of this module is such that WIDTH should always be less than HEIGHT.  
> is it possible to write an system verilog assertion just to check if this condition is always satisfied? should I use concurrent assertions or immediate assertions? is this(using sva) the best way to do it?

I would write something like the following since parameters are evaluated at elaboration time, and remain unchanged throughout the simulation.

```verilog
module m #(WIDTH=3, HEIGHT=2) (input bit a);
  initial 
   ap_wh: assert(WIDTH < HEIGHT); 
endmodule
"testbench.sv", 5: m.ap_wh: started at 0ns failed at 0ns
	Offending '(WIDTH < HEIGHT)'
https://www.edaplayground.com/x/42SK
 

```

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 978-1539769712](https://goo.gl/d10QHh)
- 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

* * *

---

_[View the full topic](https://verificationacademy.com/forums/t/assertions-to-check-parameters/32878)._
