docs/reference/system-functional/command-dispatch.md
Command dispatching is the process by which encoded command buffers are received, decoded, routed to the appropriate component for execution, and status is reported back to the command source. The Command Dispatcher is the central routing component in the F Prime commanding architecture. It connects command sources (ground systems, sequencers, or other command buffer sources) to the components that implement each command.
At system startup, each component that implements commands registers its opcodes with the Command Dispatcher. Registration associates each opcode with the specific output port connected to the implementing component. If an opcode is registered more than once on the same port, this is treated as a re-registration and is logged. If an opcode is registered from a different port, this is an assertion failure — normal topology generation prevents this condition, so it indicates a configuration error. The registration table is sized at compile time (default: 150 entries) and must be large enough to hold all opcodes in the system.
When the Command Dispatcher receives a command buffer, it performs the following steps:
The context value is a user-defined value provided by the command source. It is returned with the command status to allow the source to correlate the response with the original command.
The Command Dispatcher supports multiple command sources connected to separate input ports. Each source port has a corresponding status output port so that command completion status is returned to the correct source. The number of command source ports is configurable at compile time (default: 5).
Typical command sources include:
After a command is dispatched, it is tracked in a pending command table until the executing component reports completion. The pending command table is sized at compile time (default: 25 entries) and limits the number of commands that can be simultaneously in progress.
When the executing component reports completion, the Command Dispatcher:
The Command Dispatcher's input queue has a finite depth. If the queue is full when a new command buffer arrives, the command is dropped rather than blocking or asserting. The Command Dispatcher's queue processing is typically assigned the highest priority in the system, so overflows are most likely during a denial-of-service or command flood situation. Dropped commands are logged and counted via telemetry.
The Command Dispatcher reports the following telemetry:
The Command Dispatcher includes several built-in commands for system verification: