+1 855-VERIFYY
+

Repeat on Memory

Repeat on Memory

A memory is a storage with contiguous address locations. As the increasing integration density of various IPs into the SoC, the memory system becomes a dominant role to determine the final performance, area, and power consumption of SoC. Different memory templates are required in IDS to have different interferences of memory currently, but if the size of memory is same and different interferences with different ports are required then ‘repeat’ property on memory template can be used.

LOGIC DIAGRAM:


rep2

Verilog Code

parameter Mem1_count                                                  = 2; //number of memory repeat

generate                  //generate block for each repeat value

genvar Mem1_i;
for (Mem1_i = 0; Mem1_i < Mem1_count; Mem1_i = Mem1_i + 1)
begin: Mem1_gen

assign Mem1_offset[Mem1_i]                       = (block_offset/’h80) + ‘h0 + Mem1_i;
assign Mem1_decode[Mem1_i]                    = (address [(addr_width - 1):7] == Mem1_offset[Mem1_i] [(addr_width -7) - 1: 0])? 1′b1: 1′b0;
assign Mem1_wr_valid[Mem1_i]                = Mem1_decode[Mem1_i] && wr_stb;
assign Mem1_rd_valid[Mem1_i]                 = Mem1_decode[Mem1_i] && rd_stb && rd_wait_state;
assign Mem1_wr_valid_out[Mem1_i]       = Mem1_wr_valid[Mem1_i];
assign Mem1_rd_valid_out[Mem1_i]       = Mem1_rd_valid[Mem1_i];

assign Mem1_rd_data[Mem1_i]                 = Mem1_rd_ack_in[Mem1_i] ? Mem1_rd_data_in [(bus_width * (Mem1_i+1)) -1: (Mem1_i * bus_width)]: 32′b00000000000000000000000000000000;

end
endgenerate

UVM Code:

class block_name_block extends uvm_reg_block;
`uvm_object_utils(block_name_block)

rand block_name_Mem1_Mem1 Mem1[2];          //repeat value of memory in the block

virtual function void build();
foreach (Mem1[Mem1_i])

begin
Mem1[Mem1_i] =        block_name_Mem1_Mem1::type_id::create($sformatf(“Mem1[%0x]“, Mem1_i));
Mem1[Mem1_i].configure(this, $sformatf(“Mem1[%0x]“, Mem1_i));
end

foreach (Mem1[Mem1_i])
begin
default_map.add_mem(Mem1[Mem1_i], ‘h0 + Mem1_i * ‘h80, “RW”);
end //build() and map() function for each repeat value

USAGE:

The Memory Subsystem is an important component in uniprocessor and multiprocessor systems. It consists of temporary storage that is managed by hardware (cache) or software (scratchpad), as well as more permanent storage that is volatile (main memory) or non-volatile (Flash memory, disk, etc.). It consists of on-chip storage as well as off-chip storage

CONCLUSION:

Repeat on memory is a very convenient feature if we are prepared to interface multiple memories of same size with different ports. In such cases, the repeat property turns out to be extremely handy. Instead of using multiple IDS memory templates, we can use only one template and repeat it as many times as required.

 

By: Nikita