Struct HeaderPayloadTxStream
pub struct HeaderPayloadTxStream<Header> {
headers: Rv<Header>,
bytes: Rv<uint<8>>,
}Expand
A stream of packet headers with corresponding payload that represents generic packets. Each header corresponds to one or more bytes of payload, and the size of that payload must be known from the header alone
Headers must serialize to at least one byte.
Once a header has been accepted, the corresponding number of bytes are read from the payload
stream. The sender is responsible for ensuring that this
stream has enough bytes inside to serve header.payload_length bytes at one byte
per clock cycle
Implementations
impl<InnerHeader> HeaderPayloadTxStream<InnerHeader>
where
InnerHeader: Header,
pub entity lower<OuterHeader, #uint N>(self, clk: clock, rst: bool, header_gen: impl Fn(InnerHeader) -> OuterHeader) -> HeaderPayloadTxStream<OuterHeader>
where
InnerHeader: Serialize<[uint<8>; N]> + Header,
Lower a packet of InnerHeader into a packet of OuterHeader where the InnerHeader and its corresponding payload is the payload of the outer packet
impl<InnerHeader> HeaderPayloadTxStream<InnerHeader>
impl<InnerHeader> HeaderPayloadTxStream<InnerHeader>
pub entity append_lower_priority(self, clk: clock, rst: bool, other: HeaderPayloadTxStream<InnerHeader>) -> HeaderPayloadTxStream<InnerHeader>
Joins 2 HeaderPayloadTxStreams of the same type with different
priorities. If self does not want to transmit a packet, other is
allowed to transmit, otherwise self transmits