mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-30 00:00:11 +01:00
fpga: improve comments for fastRead and fastWrite
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
parent
a2ff0aca43
commit
f1776f8be4
3 changed files with 11 additions and 3 deletions
|
@ -139,11 +139,13 @@ private:
|
||||||
|
|
||||||
// When using SG: ringBdSize is the maximum number of BDs usable in the ring
|
// When using SG: ringBdSize is the maximum number of BDs usable in the ring
|
||||||
// Depending on alignment, the actual number of BDs usable can be smaller
|
// Depending on alignment, the actual number of BDs usable can be smaller
|
||||||
|
// We use a single BD for transfers, because this way we can achieve the best
|
||||||
|
// latency. The AXI read cache in the FPGA also only supports a single BD.
|
||||||
|
// TODO: We could make this configurable in the future.
|
||||||
static constexpr size_t requestedRingBdSize = 1;
|
static constexpr size_t requestedRingBdSize = 1;
|
||||||
static constexpr size_t requestedRingBdSizeMemory =
|
static constexpr size_t requestedRingBdSizeMemory =
|
||||||
requestedRingBdSize * sizeof(XAxiDma_Bd);
|
requestedRingBdSize * sizeof(XAxiDma_Bd);
|
||||||
uint32_t actualRingBdSize = 1; //XAxiDma_BdRingCntCalc(
|
uint32_t actualRingBdSize = 1;
|
||||||
//XAXIDMA_BD_MINIMUM_ALIGNMENT, requestedRingBdSizeMemory);
|
|
||||||
std::shared_ptr<MemoryBlock> sgRing;
|
std::shared_ptr<MemoryBlock> sgRing;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -188,6 +188,9 @@ int FpgaNode::start() {
|
||||||
return Node::start();
|
return Node::start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We cannot modify the BD here, so writes are fixed length.
|
||||||
|
// If fastWrite receives less signals than expected, the previous data
|
||||||
|
// will be reused for the remaining signals
|
||||||
int FpgaNode::fastWrite(Sample *smps[], unsigned cnt) {
|
int FpgaNode::fastWrite(Sample *smps[], unsigned cnt) {
|
||||||
Sample *smp = smps[0];
|
Sample *smp = smps[0];
|
||||||
|
|
||||||
|
@ -222,6 +225,9 @@ int FpgaNode::fastWrite(Sample *smps[], unsigned cnt) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Because we cannot modify the BD here, reads are fixed length.
|
||||||
|
// However, if we receive less data than expected, we will return only
|
||||||
|
// what we have received. fastRead is thus capable of partial reads.
|
||||||
int FpgaNode::fastRead(Sample *smps[], unsigned cnt) {
|
int FpgaNode::fastRead(Sample *smps[], unsigned cnt) {
|
||||||
Sample *smp = smps[0];
|
Sample *smp = smps[0];
|
||||||
auto mem = MemoryAccessor<float>(*blockRx);
|
auto mem = MemoryAccessor<float>(*blockRx);
|
||||||
|
|
Loading…
Add table
Reference in a new issue