UVM_MEM with Write Only access

Creating a UVM_MEM with access rights “WO” is not possible.
In the configure function of uvm_mem an error is thrown.
But the get_rights function’s documentation WO is one of the possible return values.

Is a WO memory not supported or is this some kind of bug?

Thanks,

In reply to kristof.marien@nokia.com:
Could you please provide some more information, like a piece of code and the exact error message.

In the source code of the uvm_mem configure function you can find this code:


   if (m_access != "RW" && m_access != "RO") begin
      `uvm_error("RegModel", {"Memory '",get_full_name(),"' can only be RW or RO"})
      m_access = "RW";
   end

And the documentation of get_rights is:

// Function: get_rights
   //
   // Returns the access rights of this memory.
   //
   // Returns "RW", "RO" or "WO".
   // The access rights of a memory is always "RW",
   // unless it is a shared memory
   // with access restriction in a particular address map.
   //
   // If no address map is specified and the memory is mapped in only one
   // address map, that address map is used. If the memory is mapped
   // in more than one address map, the default address map of the
   // parent block is used.
   //
   // If an address map is specified and
   // the memory is not mapped in the specified
   // address map, an error message is issued
   // and "RW" is returned. 
   //

In reply to kristof.marien@nokia.com:

The questions is how your configure function looks like.

In reply to chr_sue:

We did not override the configure function. That function is called in the constructor of this memory as follows:


function new (string name = "my_mem");
   super.new(name, 256, 32, "WO", UVM_NO_COVERAGE);
endfunction : new

In reply to kristof.marien@nokia.com:

Memory is not added to your Register model in your UVM testbench. You are adding there an address map like this:

uvm_mem rx_fifo_mem;

  virtual function void build;
     rx_fifo_mem = new( "rx_fifo_mem", 128, 16 );

     // HDL path inside the design
     rx_fifo_mem.add_hdl_path_slice("rx_fifo", 0, 16);

     rx_fifo_mem.configure( .parent(this), .hdl_path("") );

     // Add the memory to the register map
     default_map.add_mem(rx_fifo_mem, .offset(512), 
                                      .rights("RW"));
     //                               .unmapped(1));

In reply to chr_sue:

Ok, that is the configure of the block wrapping the memory.

In my code it is like this:


my_mem m_mem;

virtual function void build();
   this.m_mem = new("my_mem");

   this.m_mem.configure(this);

   this.default_map.add_mem(this.m_mem, 0, "WO");
endfunction : build

In reply to kristof.marien@nokia.com:

I had a look to the UVM Standard (2017)

It says:

virtual function string get_rights (
uvm_reg_map map = null
)

Returns the access rights of this memory.
This returns “RW”, “RO”, or “WO”. The access rights of a memory is always “RW”, unless it is a shared memory with access restriction in a particular address map.
If no address map is specified and the memory is mapped in only one address map, that address map is used.
If the memory is mapped in more than one address map, the default address map of the parent block is used.
If an address map is specified and the memory is not mapped in the specified address map, a warning message shall be issued and “RW” is returned.

I understand WO is not permitted because of " The access rights of a memory is always “RW”, unless … ".
And ‘unless’ means the other option is “RO”.