How Do You Initialize Uvm_Mem?

How Do You Initialize Uvm_Mem?

Suppose I have an input file (someinputdata.txt) to be loaded in the uvm-based memory which is declared as follows and instantiated somewhere on a register block (a class that extends a uvm_reg_block).

class mymemory extends uvm_mem;
   `uvm_object_utils(mymemory)

   function new(string name = "mymemory");
      super.new(name, 32'h800, 32, "RW", UVM_NO_COVERAGE);
   endfunction

endclass

I'm not sure if there is a built-in function to load an input file to uvm_mem.

How do you efficiently load someinputdata.txt to this memory?

1 Answer

The uvm_mem class does not have a mirror of the actual memory. You will have to load it via a front-door or back-door method that you need to define. Back-door is preferred, so you need to define a user-defined backdoor access by extending the uvm_reg_backdoor class and implementing the write() method to write to the memory model as required.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Elena Rostova
Author

Elena Rostova

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.