MTX ID value is read from register given by the CDP instruction and is the MTXID register is set accordingly. EG: cdp p0 0X0 C5 C4 C3 will take the value from register C5  and set it to MTXID. Next step is use the context of the current thread instead of the for loop and run a sample test case.After that code cleanup and moving to gem5 stable.