# Advice for simplifying constraint

**URL:** <https://verificationacademy.com/forums/t/advice-for-simplifying-constraint/39881>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, constraint-randomization\
**Created:** [December 10, 2021, 7:29am UTC](https://verificationacademy.com/forums/t/advice-for-simplifying-constraint/39881 "2021-12-10T07:29:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [December 10, 2021, 5:55pm UTC](https://verificationacademy.com/forums/t/advice-for-simplifying-constraint/39881/2 "2021-12-10T17:55:24Z")

</div>

_In reply to [bhupeshpaliwal](https://verificationacademy.com/forums/t/advice-for-simplifying-constraint/39881):_

I was able to get a result for num == 63, which is the largest possible value, for all simulators on EDAPlayground. I noticed you had some typos (= instead of ==), so maybe you did not copy the example correctly and missed something. Or maybe you have hit a tool specific issue. Some comments for optimizations:

1. Use dynamic arrays instead of queues [$] for quicker access unless you plan on pushing or popping values.
2. You only need to check s\_addr[0] for byte alignment.
3. You could calculate bsz, bl, and the array sizes in pre\_randomize to simplify the constraint equations.
4. You could calculate e\_addr in post\_randomize to simplify the constraint equations.

---

_[View the full topic](https://verificationacademy.com/forums/t/advice-for-simplifying-constraint/39881)._
