Add memory dump function to test bench