What causes threads to start?

eTPU_C

Threads are started by eTPU events (host/link service or match/capture events). Execution starts at the ETPU_function associated with a channel.

In eTPU_C, the if()..else if()..else structure "tests" the channel conditions, and causes the appropriate code to execute. The compiler translates the if() structure into the channel condition encoding, and uses that as position information for the thread entry point in that ETPU_function's portion of the entry table.

Though all the tests available to you in this context are valid (they aren't misleading), some of the tests check what caused the thread to start, and others check parametric information.

  • Threads are actually invoked by Host Service Requests (hsr set to something other than 0), Link Service Requests from another thread, or Match or Transition events.

  • Pin state and flag states (Flag0 and Flag1) are testable but are never directly responsible for a thread starting.

  • There is always an implied test of hsr. A thread that doesn't explicitly test hsr will still only run when

    hsr == 0