Queue insertion and communication latency#

An enqueue request travels from CPU-side timing control to the TCU through a mailbox. The TCU accepts its time point and all port events together. A full queue leaves the request pending in the mailbox.

Connections#

  • Input: the timing control’s submitted TimingEvents through ControlLinks::timing_events.

  • Output: entries in the TCU timing and event queues, followed by an EnqueueReply through the return mailbox.

  • Scheduling: the TCU checks an arrived request on a TCU rising edge; the CPU receives its reply on a later CPU edge.

Mailbox communication and acceptance#

Mailbox arrival follows the receiver-edge latency rule.

The TCU checks the request’s event IDs, profile fingerprint, label order, deadline and required capacity. When space is available, it inserts the time point and all its events together. Core::tcu_edge() removes the request from the mailbox and sends an EnqueueReply with its label.

Enqueue checks capacity at the start of the TCU edge, before any entries are removed. A request waiting for space retains its original deadline.

Insertion normally must finish strictly before the due tick. While an empty queue is paused after wait 0, a point due at the frozen cycle may be inserted on that cycle’s current edge. A newly inserted time point cannot trigger on the same edge. See pause and deadline rules and TCU edge order.

Objects and state#

Object or member

Representation

Role

timing_events, replies, closure

Mailboxes of TimingEvents, EnqueueReply and EndOfStream

One-slot communication paths between timing control and TCU.

Envelope

published, eligible, epoch, value

Retains the payload until its receiver can consume it.

TcuCycleModel::last_label_

last enqueued label

Enforces ordered, nonduplicate submission.

timing_, events_

TCU queues

Enqueue checks occupancy at the start of the edge before inserting the whole time point.

C++ API.

Reset and errors#

Malformed time points, duplicate or stale identities, impossible capacity and late arrival raise typed faults. The TCU validates the whole transition before committing its queue changes. A fault in candidate enqueue also suppresses any output planned by that TCU transition.

Session reset clears the communication mailboxes and TCU queues. Epoch checks prevent old work from entering the new session.

Implementation and tests#

Source: tcu.cpp and mailbox.hpp.

CTest: core.mailbox, control.admission, control.atomic.

The tests check delivery on a strictly later receiver edge and enqueue using capacity from the start of the edge. Failed validation must leave queues unchanged.