Integegration of gem5 and nvmain