Uvm_mem_mam

Hi,
I am creating a memory model and want to allocate some regions inside that memory with uvm_mem_mam. I have a class extended from uvm_mem. In my test I am trying to use the mam’s API but getting NULL POINTER DEREFERENCE Error from the tool.

Below is the code looks like in my test:
uvm_mem_region buffer1;

buffer1 = reg_model.RAM.mam.reserve_region('h0000,10);

I have created the reg_model in my environment. RAM is my uvm_mem which is also created inside the regmodel. I am not sure if I am using the mam’s api in a correct way or not. Could someone please help me out with this? Also, let me know if you need any additional details/info.

Thank You.