I need to generate HEX File depending on the random parameter passed from the test sequence and also how to preload DUT memory

Hi All ,

My task is to generate the-hex file depending on the parameter which i will be sending through one task inside sequence (only that number of lines should be filled in the hexfile)

e.g. task preloading_mem(random parameter )
$readmemh(imp00_hex , mem00)
end
How can i achieve this ?

What approach i can follow , when i want to preload only DUT memory ?

Lookup $readmem in the LRM for extra arguments