# Move function for a memory model based class

**URL:** <https://verificationacademy.com/forums/t/move-function-for-a-memory-model-based-class/35147>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, Move-Memory-Class\
**Created:** [October 7, 2018, 10:49am UTC](https://verificationacademy.com/forums/t/move-function-for-a-memory-model-based-class/35147 "2018-10-07T10:49:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Madineni](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/9d8465/32.png) [@Madineni](https://verificationacademy.com/forums/u/Madineni)\
**Post date:** [October 23, 2018, 2:03pm UTC](https://verificationacademy.com/forums/t/move-function-for-a-memory-model-based-class/35147/3 "2018-10-23T14:03:50Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/move-function-for-a-memory-model-based-class/35147/2):_

Hi Dave,

Thanks for your reply.

The memory model class is something like below and need to implement the move function so that it will give output as described below.

Source code:

```verilog
class memory_model # (int DEPTH = 1024);
  localparam ADDR_W = $clog2(DEPTH);
  bit [7:0] mem[DEPTH];
  
  extern virtual function void move ( bit [ADDR_W-1:0] source_address, 
                                      bit [ADDR_W-1:0] dest_address,
                                      bit [ADDR_W-1:0] size
                                    ); 

endclass: memory_model

```

Expected output:  
move(0, 10, 5)  
0 - \> 10  
1 - \> 11  
2 - \> 12  
3 - \> 13  
4 - \> 14

implement the move function to get the expected output?

Thanks and Regards,  
Madineni

---

_[View the full topic](https://verificationacademy.com/forums/t/move-function-for-a-memory-model-based-class/35147)._
