Hello,

My aim is to copy the context of a thread to another thread which runs on different cpu. According to the definition of takeOverFrom() in gem5/src/cpu/thread_context.cc, we can copy thread contexts:

/**
 * Copy state between thread contexts in preparation for CPU handover.
 *
 * @note This method modifies the old thread contexts as well as the
 * new thread context. The old thread context will have its quiesce
 * event descheduled if it is scheduled and its status set to halted.
 *
 * @param new_tc Destination ThreadContext.
 * @param old_tc Source ThreadContext.
 */void takeOverFrom(ThreadContext &new_tc, ThreadContext &old_tc);

However, after I used takeOverFrom() function, the newly copied thread (other_tc) cannot be activated and it gives an error in activateContext() function.

    tc->suspend();
    tc->pcState(tc->nextInstAddr());
    other_tc->takeOverFrom(tc);

Am I doing something wrong? Can I copy the content of a thread to another one like that?
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to