# 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:** 9

<div class="post-metadata">

**Author:** ![sfenil1804](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/76d3ee/32.png) [@sfenil1804](https://verificationacademy.com/forums/u/sfenil1804)\
**Post date:** [June 27, 2020, 8:59pm UTC](https://verificationacademy.com/forums/t/constraint-for-address-to-be-inside-4k-boundary/37655/9 "2020-06-27T20:59:35Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/constraint-for-address-to-be-inside-4k-boundary/37655/8):_

What changes should be made to generate a constraint that won’t cross the 1k boundary for the AHB bus protocol? Given the following variables?

```verilog
class packet;
  
  rand bit [31:0] Haddr;
  rand bit [2:0] Hburst;
  rand bit [2:0] Hsize;
  
endclass

```

---

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