lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Drp::Gpu::CoreRegisters Class Reference

Access to the GpuAsyncCore registers, either through a GpuAsyncCoreRegs object on the mapped firmware registers or, in simulator mode, through a plain memory block laid out like them. More...

#include <gpuUtils.hh>

Public Member Functions

 CoreRegisters ()
 Start with neither register object nor simulated block; initialize() must be called before use.
 
void initialize (bool sim, void *regs)
 If sim is false, wrap the mapped registers at regs in a new GpuAsyncCoreRegs; otherwise use regs as the simulated register block.
 
uint32_t dmaDataBytes () const
 Return the DMA data bytes field (GpuAsyncReg_DmaDataBytes when simulated).
 
void setDataBytes (uint32_t val)
 Set the DMA data bytes field in simulator mode; does nothing with real registers.
 
uint32_t writeEnable () const
 Return the write enable field (GpuAsyncReg_WriteEnableV1 when simulated).
 
void setWriteEnable (uint32_t val)
 Set the write enable field.
 
void setWriteCount (uint32_t val)
 Set the write count field (GpuAsyncReg_WriteCountV1 when simulated); MemPoolGpu writes the number of DMA buffers less 1.
 
uint32_t axisDeMuxSelect () const
 Return the AXI stream demux select field, which dmaTgtGet() reads.
 
void setAxisDeMuxSelect (uint32_t val)
 Set the AXI stream demux select field, which dmaTgtSet() writes.
 
void returnFreeListIndex (uint32_t buffer)
 Call GpuAsyncCoreRegs::returnFreeListIndex(buffer); in simulator mode, write 1 to the register at freeListOffset(buffer).
 
uint32_t freeListOffset (uint32_t buffer) const
 Return the register offset of the free-list entry of buffer (GPU_ASYNC_REG_WRITE_DETECT_OFFSET_V1 when simulated).
 
void setRemoteWriteMaxSize (uint32_t buffer, uint32_t size)
 Set the remote write maximum size of buffer (GPU_ASYNC_REG_WRITE_SIZE_OFFSET_V1 when simulated); MemPoolGpu sets it to the DMA buffer size.
 

Detailed Description

Access to the GpuAsyncCore registers, either through a GpuAsyncCoreRegs object on the mapped firmware registers or, in simulator mode, through a plain memory block laid out like them.

Constructor & Destructor Documentation

◆ CoreRegisters()

Drp::Gpu::CoreRegisters::CoreRegisters ( )
inline

Start with neither register object nor simulated block; initialize() must be called before use.

Member Function Documentation

◆ axisDeMuxSelect()

uint32_t Drp::Gpu::CoreRegisters::axisDeMuxSelect ( ) const
inline

Return the AXI stream demux select field, which dmaTgtGet() reads.

◆ dmaDataBytes()

uint32_t Drp::Gpu::CoreRegisters::dmaDataBytes ( ) const
inline

Return the DMA data bytes field (GpuAsyncReg_DmaDataBytes when simulated).

MemPoolGpu uses it as the DMA header size (per its code comment, DMA_AXI_CONFIG_G.DATA_BYTES_C).

◆ freeListOffset()

uint32_t Drp::Gpu::CoreRegisters::freeListOffset ( uint32_t  buffer) const
inline

Return the register offset of the free-list entry of buffer (GPU_ASYNC_REG_WRITE_DETECT_OFFSET_V1 when simulated).

◆ initialize()

void Drp::Gpu::CoreRegisters::initialize ( bool  sim,
void *  regs 
)

If sim is false, wrap the mapped registers at regs in a new GpuAsyncCoreRegs; otherwise use regs as the simulated register block.

◆ returnFreeListIndex()

void Drp::Gpu::CoreRegisters::returnFreeListIndex ( uint32_t  buffer)
inline

Call GpuAsyncCoreRegs::returnFreeListIndex(buffer); in simulator mode, write 1 to the register at freeListOffset(buffer).

◆ setAxisDeMuxSelect()

void Drp::Gpu::CoreRegisters::setAxisDeMuxSelect ( uint32_t  val)
inline

Set the AXI stream demux select field, which dmaTgtSet() writes.

◆ setDataBytes()

void Drp::Gpu::CoreRegisters::setDataBytes ( uint32_t  val)
inline

Set the DMA data bytes field in simulator mode; does nothing with real registers.

◆ setRemoteWriteMaxSize()

void Drp::Gpu::CoreRegisters::setRemoteWriteMaxSize ( uint32_t  buffer,
uint32_t  size 
)
inline

Set the remote write maximum size of buffer (GPU_ASYNC_REG_WRITE_SIZE_OFFSET_V1 when simulated); MemPoolGpu sets it to the DMA buffer size.

◆ setWriteCount()

void Drp::Gpu::CoreRegisters::setWriteCount ( uint32_t  val)
inline

Set the write count field (GpuAsyncReg_WriteCountV1 when simulated); MemPoolGpu writes the number of DMA buffers less 1.

◆ setWriteEnable()

void Drp::Gpu::CoreRegisters::setWriteEnable ( uint32_t  val)
inline

Set the write enable field.

MemPoolGpu writes 0 to stop the FPGA side, and dmaIdxReset() writes 0 then 1 to reset the DMA buffer index (per the code comments).

◆ writeEnable()

uint32_t Drp::Gpu::CoreRegisters::writeEnable ( ) const
inline

Return the write enable field (GpuAsyncReg_WriteEnableV1 when simulated).


The documentation for this class was generated from the following file: