Uvm_mem usage

I am trying to create a memory model class with memory and methods to allocate and deallocate memory dynamically.
I came across uvm_mem and thought I will be able to achieve the functionality I needed due to the memory manager instance present in uvm_mem.

I wrote a basic code :
*module test();

class mem_1_model extends uvm_mem;

`uvm_object_utils(mem_1_model)

function new(string name = “mem_1_model”);
super.new(name, 32’h2000, 32, “RW”, UVM_NO_COVERAGE);
endfunction

endclass: mem_1_model
initial
begin
mem_1_model DDR;
uvm_mem_region SQ_BA,RQ_BA,DATA_BA;
DDR = new();
$display(“RIGHTS %0s”,DDR.get_rights());
SQ_BA = DDR.mam.request_region(2);
if(SQ_BA == null)
$display("Region 1 NULL ");
end

endmodule*
KERNEL: RIGHTS RW

RUNTIME: Fatal Error: RUNTIME_0029 uvm_mem_mam.svh (759): Null pointer access.

This returns the property correctly but request_region() call returns a null pointer.

Is there anything I am missing here ?

Regards

In reply to new():

The uvm_mem class is part of the UVM Register Model. You can’t use this class outside of a register model.

In reply to cgales:
uvm_mem
Memory abstraction base class
Class Hierarchy
uvm_void
uvm_object
uvm_mem
Class Declaration
class uvm_mem extends uvm_object
https://verificationacademy.com/verification-methodology-reference/uvm/docs_1.1a/html/files/reg/uvm_mem_mam-svh.html#uvm_mem_region