Professional Documents
Culture Documents
Meenakshy Ramachandran
Synopsys India Pvt. Ltd.
Class Definition
Memory Controller Challenges in Verification
HOST DDR
parameter PAGE_SIZE = 4096; //4KB
parameter OFFSET_WIDTH = $clog2(PAGE_SIZE);
HOST MEMORY
Generation of address stimuli must be:
NTERFACE INTERFACE
MEMORY
MEMORY
CONTROLLER MEMORY class address_generator;
COMMANDS CONTROL
• Random for vast distribution rand bit[63:0] addr; //start address of the memory block
DATA IN / OUT DATA IN / OUT
• Constrained for accuracy rand bit align = 1; //Aligned: align = 1. Unaligned: align = 0
• Controlled for corner case scenarios rand bit[OFFSET_WIDTH - 1:0]offset; //The offset
bit [63:0] start_address = 64'h0000_0000_0000_0000; //The lower limit of the address range
Objective: Faster simulation for quick closure of bit [63:0] end_address = 64'hFFFF_FFFF_FFFF_FFFF; //The upper limit of the address range
• controls flow of data between host memory and int block_size; //The memory block size
dynamic memory verification while achieving all of the above
int page_size = PAGE_SIZE; //The memory page size
ADDRESS MEMORY PAGE int offset_width = OFFSET_WIDTH; //The offset width
• host memory is divided into pages 0x0000_0000_0000_0000 Byte 0
0x0000_0000_0000_0001 Byte 1 /** Aligned: offset = 0. Unaligned: offset > 0 */
Offset
Approach II Approach IV
• Memory block range compressed to {start_address/page_size, end_address/page_size} • Addresses generated using Verilog function $urandom_range
• Actual address retrieved as [(Generated address * Page size) + Offset] • Lower and upper words generated separately because function generates only 32 bit integers
Verdict Verdict
Because the address range is now compressed, the queue used_address_list is populated with a single address Although slightly faster than the previous approach, randomization control is lost. It is a trade off between
instead of all addresses within a page. Constraint solver takes much lesser time since search list is very short. randomization control and simulation speed.
Application of the most efficient address generator for 128 MB data transfer
Comparative analysis highlights Approach III as the best suited for efficient constrained random generation of address blocks Around 43,529 address blocks, aligned and unaligned, generated in random for the same
Performance of same approach studied by applying it to generate address blocks capable of holding data up to 128 MB and more A very nominal CPU time of 2.64 seconds recorded for the entire simulation
meenakshy.ramachandran@synopsys.com