CIRCT 24.0.0git
Loading...
Searching...
No Matches
esi::Segment Struct Reference

A contiguous, non-owning view of bytes within a SegmentedMessageData. More...

#include <Common.h>

Collaboration diagram for esi::Segment:

Public Member Functions

std::span< const uint8_t > span () const
bool empty () const
std::optional< uint64_t > getDeviceAddress () const
 Device address of this segment's bytes, if region is set and contains them; std::nullopt otherwise.

Public Attributes

const uint8_t * data
size_t size
services::HostMemRegion * region = nullptr
 The HostMem region (from services::HostMem::allocate()) which holds [data, data + size), if any.

Detailed Description

A contiguous, non-owning view of bytes within a SegmentedMessageData.

Valid only while the owning SegmentedMessageData is alive.

Definition at line 122 of file Common.h.

Member Function Documentation

◆ empty()

bool esi::Segment::empty ( ) const
inline

Definition at line 132 of file Common.h.

References size.

◆ getDeviceAddress()

std::optional< uint64_t > Segment::getDeviceAddress ( ) const

Device address of this segment's bytes, if region is set and contains them; std::nullopt otherwise.

Definition at line 80 of file Common.cpp.

References data, region, and size.

Referenced by serialCoordTranslate().

◆ span()

std::span< const uint8_t > esi::Segment::span ( ) const
inline

Definition at line 131 of file Common.h.

References data, and size.

Referenced by esi::SegmentedMessageDataCursor::remaining().

Member Data Documentation

◆ data

◆ region

services::HostMemRegion* esi::Segment::region = nullptr

The HostMem region (from services::HostMem::allocate()) which holds [data, data + size), if any.

Several segments may share a region. Non-owning: the SegmentedMessageData keeps the region alive; backends may be able to obtain ownership via SegmentedMessageData::take().

Definition at line 129 of file Common.h.

Referenced by checkHostMemTake(), esiaccel.types.MMIORegion::descriptor(), getDeviceAddress(), esiaccel.types.MMIORegion::read(), esi::SegmentedMessageDataCursor::remainingSegment(), serialCoordTranslate(), and esiaccel.types.MMIORegion::write().

◆ size


The documentation for this struct was generated from the following files: