Stimulus[Buffer|Frame]: initial impl, unoptimized for mem use

This commit is contained in:
2025-11-16 16:09:35 -04:00
parent a4493b26a1
commit 3f04d1b387
9 changed files with 152 additions and 98 deletions
+6 -8
View File
@@ -5,6 +5,7 @@
#include <vector>
#include <memory>
#include <user/spMcRingBuffer.h>
#include <user/stagingBuffer.h>
#include "stimulusFrame.h"
#include "deviceAttachmentSpec.h"
@@ -28,15 +29,16 @@ public:
const std::shared_ptr<device::DeviceAttachmentSpec>
&deviceAttachmentSpec,
int histbuffMs,
const SpMcRingBuffer::InputEngineConstraints& ringBufferConstraints)
const StagingBuffer::IOEngineConstraints& inputEngineConstraints,
const StagingBuffer::IOEngineConstraints& outputEngineConstraints,
size_t nSlotsPerStimFrame)
: parent(parent),
deviceAttachmentSpec(deviceAttachmentSpec),
histbuffMs(histbuffMs),
frames_(static_cast<size_t>(histbuffMs / CONFIG_STIMBUFF_FRAME_PERIOD_MS)),
ringBufferConstraints(ringBufferConstraints),
ringBuffer(
static_cast<size_t>(histbuffMs / CONFIG_STIMBUFF_FRAME_PERIOD_MS),
ringBufferConstraints)
inputEngineConstraints, outputEngineConstraints,
nSlotsPerStimFrame)
{}
virtual ~StimulusBuffer() = default;
@@ -51,10 +53,6 @@ public:
StimulusProducer& parent;
std::shared_ptr<device::DeviceAttachmentSpec> deviceAttachmentSpec;
int histbuffMs;
std::vector<StimulusFrame> frames_;
protected:
SpMcRingBuffer::InputEngineConstraints ringBufferConstraints;
SpMcRingBuffer ringBuffer;
};