Skip to main content

chronon::sender::DelayOneBroadcastFabric

More...

#include <DelayOneBroadcastFabric.hpp>

Public Functions

Name
voidsealPortTopology()
voidpublish(size_t producer, uint64_t send_cycle, const T & value)
Single-producer operation for one producer lane.
voidpublish(size_t producer, uint64_t send_cycle, T && value)
Move-enabled publish for models that construct a payload in place.
boolportTopologySealed() const
uint64_tconsumedExclusive(size_t consumer) const
template <typename Fn >
void
consume(size_t consumer, uint64_t consumer_cycle, Fn && fn)
voidbindProducer(size_t producer, OutPort< T > & port)
voidbindConsumer(size_t consumer, InPort< T > & port)

Public Attributes

Name
size_tRING_DEPTH
size_tPRODUCER_COUNT
size_tMAX_MESSAGES_PER_PRODUCER_CYCLE
size_tCONSUMER_COUNT

Detailed Description

template <typename T ,
size_t ProducerCount,
size_t ConsumerCount,
size_t RingDepth =512,
size_t MaxMessagesPerProducerCycle =8>
class chronon::sender::DelayOneBroadcastFabric;

Shared delay-one broadcast transport.

A conventional P-producer/C-consumer port bus stores each payload C times and executes P*C queue pushes. This fabric stores each producer payload once in a cycle-indexed lane and lets every consumer replay the source cycle one tick later. The original OutPort -> InPort connections remain in the dependency graph, but sealPortTopology() marks their physical queues as dependency-only.

This intentionally is not a drop-in general queue:

  • every bound connection must have delay=1;
  • every consumer must call consume() on each scheduled tick and drain the callback synchronously; publish() preserves normal port wakeups, and forward cycle gaps are treated as activity-scheduled empty cycles;
  • model-visible bounded capacity, InPort selective cancellation and OutPort::cancelInFlight() are outside this transport's contract.

Those restrictions keep the hot path to one producer-owned write and read-only replay by consumers. Models opt in explicitly and retain their existing OutPort/InPort graph solely for scheduler ordering.

Public Functions Documentation

function sealPortTopology

inline void sealPortTopology()

Validate the complete P x C, delay=1 bus and disable its payload queues. Call after all graph connections are created and before simulation initialization. A failure leaves every connection in its original transport mode.

function publish

inline void publish(
size_t producer,
uint64_t send_cycle,
const T & value
)

Single-producer operation for one producer lane.

function publish

inline void publish(
size_t producer,
uint64_t send_cycle,
T && value
)

Move-enabled publish for models that construct a payload in place.

function portTopologySealed

inline bool portTopologySealed() const

function consumedExclusive

inline uint64_t consumedExclusive(
size_t consumer
) const

function consume

template <typename Fn >
inline void consume(
size_t consumer,
uint64_t consumer_cycle,
Fn && fn
)

Replay send_cycle=(consumer_cycle-1), first by stable producer id and then by original send order. The scheduler's dependency-only edges are the synchronization contract: every producer must have completed the source cycle before its consumer calls this function.

function bindProducer

inline void bindProducer(
size_t producer,
OutPort< T > & port
)

Bind a stable producer id to its declared OutPort.

function bindConsumer

inline void bindConsumer(
size_t consumer,
InPort< T > & port
)

Bind a stable consumer id to its declared InPort.

Public Attributes Documentation

variable RING_DEPTH

static size_t RING_DEPTH = RingDepth;

variable PRODUCER_COUNT

static size_t PRODUCER_COUNT = ProducerCount;

variable MAX_MESSAGES_PER_PRODUCER_CYCLE

static size_t MAX_MESSAGES_PER_PRODUCER_CYCLE = MaxMessagesPerProducerCycle;

variable CONSUMER_COUNT

static size_t CONSUMER_COUNT = ConsumerCount;

Updated on 2026-07-17 at 17:43:31 +0000