# Constraint for address to be inside 4k boundary

**URL:** <https://verificationacademy.com/forums/t/constraint-for-address-to-be-inside-4k-boundary/37655>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, constraints\
**Created:** [June 1, 2020, 11:00am UTC](https://verificationacademy.com/forums/t/constraint-for-address-to-be-inside-4k-boundary/37655 "2020-06-01T11:00:23Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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:** [June 1, 2020, 7:11pm UTC](https://verificationacademy.com/forums/t/constraint-for-address-to-be-inside-4k-boundary/37655/7 "2020-06-01T19:11:27Z")

</div>

_In reply to [Chandrashekhar Goudar](https://verificationacademy.com/forums/t/constraint-for-address-to-be-inside-4k-boundary/37655/6):_

The problem with your constraint is the   
mtestADDR%4096 just gives you the offset into the 4K boundary. You just need

```verilog
constraint addr_in_4k { mtestADDR%4096 + (mtestBurstLength + 1 << mtestDataSize) <= 4096;}

```

---

_[View the full topic](https://verificationacademy.com/forums/t/constraint-for-address-to-be-inside-4k-boundary/37655)._
