frame_merge4 HDL Worker
Round-robin, frame-atomic 4-to-1 merge of uchar_timed_sample decoded-frame
streams.
Detail
The worker implements a two-state FSM (ST_ARB / ST_FWD) clocked on
ctl_in.clk.
Arbitration (ST_ARB)
A combinational scan of pv(3:0) — where pv(k) = in<k>_in.ready AND
in<k>_in.valid — selects the first available input starting at the
round-robin pointer rr. The scan is unrolled as a for k in 0 to 3
loop with a found flag so only the first hit is latched. The selected
index is stored in lp and the FSM moves to ST_FWD.
Forwarding (ST_FWD)
The locked input’s data, opcode, som, eom, and
byte_enable signals are combinationally muxed onto the output port. A
transfer (xfer) occurs when the locked input has a beat available
(pv(lp) = '1') and the downstream asserts ready. On each transfer,
in<lp>_out.take is asserted; all other inputs hold their take low.
The FSM leaves ST_FWD when xfer = '1' and the current beat is a
sample-opcode EOM (se(lp) = '1'). se(k) is defined as:
se(k) <= '1' when in<k>_in.eom = '1' and
in<k>_in.opcode = uchar_timed_sample_sample_op_e
else '0';
This condition fires on the last byte of the 134-byte sample message, which
is always the second message in a frame unit. The metadata-message EOM does
not satisfy se (wrong opcode), so the arbiter remains locked across the
gap between the two messages.
On returning to ST_ARB the round-robin pointer advances: rr <= (lp + 1)
mod 4.
EOF
output_out.eof is driven combinationally:
output_out.eof <= '1' when in0_in.eof = '1' and in1_in.eof = '1' and
in2_in.eof = '1' and in3_in.eof = '1' and
pv = "0000" and state = ST_ARB
else '0';
All four conditions must hold simultaneously to prevent premature EOF while any input still holds unforwarded frames.
Reset
Synchronous, active-high reset on ctl_in.reset. state, lp, and
rr are all reset to zero.
Worker Properties
ocpi_buffer_size_outputType:
ushortAccess:
Parameter:
FalseWritable:
FalseInitial:
TrueVolatile:
FalseRead back:
False
Default value:
0
ocpi_blocked_outputType:
ulongAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
TrueRead back:
False
Default value:
None
ocpi_max_latency_outputType:
ushortAccess:
Parameter:
TrueWritable:
FalseInitial:
FalseVolatile:
FalseRead back:
False
Default value:
None
ocpi_latency_outputType:
ushortAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
TrueRead back:
False
Default value:
None
ocpi_messages_outputType:
ulongAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
TrueRead back:
False
Default value:
None
ocpi_bytes_outputType:
ulongAccess:
Parameter:
FalseWritable:
FalseInitial:
FalseVolatile:
TrueRead back:
False
Default value:
None
Worker Ports
in0Protocol:
uchar_timed_sampleOptional:
False
in1Protocol:
uchar_timed_sampleOptional:
False
in2Protocol:
uchar_timed_sampleOptional:
False
in3Protocol:
uchar_timed_sampleOptional:
False
outputProtocol:
uchar_timed_sampleOptional:
False
Inputs:
Outputs:
Worker Ports
Inputs:
in0:Type:
StreamInterfaceProtocol:
uchar_timed_sample-protClockDirection:
inData width:
8
in1:Type:
StreamInterfaceProtocol:
uchar_timed_sample-protClockDirection:
inData width:
8
in2:Type:
StreamInterfaceProtocol:
uchar_timed_sample-protClockDirection:
inData width:
8
in3:Type:
StreamInterfaceProtocol:
uchar_timed_sample-protClockDirection:
inData width:
8
Outputs:
output:Type:
StreamInterfaceProtocol:
uchar_timed_sample-protWorker EOF:
trueClock:
in0Data width:
8
Utilisation
Utilization reporting is not currently implemented.