1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

ips/rtds2gpu: use new connect interface

This commit is contained in:
Daniel Krebs 2018-06-04 17:29:36 +02:00
parent 194c4e3eef
commit 92bfe849b4
3 changed files with 17 additions and 10 deletions

View file

@ -24,12 +24,16 @@ public:
size_t getMaxFrameSize();
// void dumpDoorbell(uint32_t doorbellRegister) const;
const StreamVertex&
getDefaultMasterPort() const
{ return getMasterPort(rtdsOutputStreamPort); }
private:
bool updateStatus();
private:
static constexpr const char* rtdsOutputStreamPort = "rtds_output";
struct StatusControlRegister { uint32_t
status_ap_vld : 1,
_res : 31;

View file

@ -32,12 +32,16 @@ public:
{ return { registerMemory }; }
const StreamVertex&
getDefaultSlavePort() const
{ return getSlavePort(rtdsInputStreamPort); }
private:
bool updateStatus();
private:
static constexpr const char* axiInterface = "m_axi_axi_mm";
static constexpr const char* streamInterface = "rtds_input";
static constexpr const char* rtdsInputStreamPort = "rtds_input";
XRtds2gpu xInstance;

View file

@ -117,9 +117,8 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu")
dumpMem(dataDst2, dmaMemDst2.getMemoryBlock().getSize());
// connect DMA to Rtds2Gpu IP
// TODO: this should be done automatically
cr_assert(axiSwitch->connect(6, 7));
// connect AXI Stream from DMA to Rtds2Gpu IP
cr_assert(dma->connect(rtds2gpu));
cr_assert(rtds2gpu.startOnce(dmaMemDst.getMemoryBlock(), SAMPLE_COUNT, DATA_OFFSET*4, DOORBELL_OFFSET*4),
"Preparing Rtds2Gpu IP failed");
@ -130,7 +129,6 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu")
cr_assert(dma->writeComplete(),
"DMA failed");
while(not rtds2gpu.isFinished());
const uint32_t* doorbellDst = &dmaMemDst[DOORBELL_OFFSET];
@ -139,13 +137,14 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu")
cr_assert(memcmp(dataSrc, dataDst, FRAME_SIZE) == 0, "Memory not equal");
(void) dmaMemDst2;
(void) dataDst2;
for(size_t i = 0; i < SAMPLE_COUNT; i++) {
gpu2rtds->registerFrames[i] = dmaMemDst[i];
}
cr_assert(axiSwitch->connect(7, 6));
// connect AXI Stream from Gpu2Rtds IP to DMA
cr_assert(gpu2rtds->connect(*dma));
cr_assert(dma->read(dmaMemDst2.getMemoryBlock(), FRAME_SIZE),
"Starting DMA S2MM transfer failed");
@ -156,7 +155,7 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu")
cr_assert(dma->readComplete(),
"DMA failed");
while(not rtds2gpu.isFinished());
while(not gpu2rtds->isFinished());
cr_assert(memcmp(dataSrc, dataDst2, FRAME_SIZE) == 0, "Memory not equal");