Commit b7683f49 authored by Daniel Krebs's avatar Daniel Krebs
Browse files

ips/rtds2gpu: use new connect interface

parent d40b3eaa
Pipeline #52943 failed with stages
in 1 minute and 6 seconds
...@@ -24,12 +24,16 @@ public: ...@@ -24,12 +24,16 @@ public:
size_t getMaxFrameSize(); size_t getMaxFrameSize();
// void dumpDoorbell(uint32_t doorbellRegister) const; const StreamVertex&
getDefaultMasterPort() const
{ return getMasterPort(rtdsOutputStreamPort); }
private: private:
bool updateStatus(); bool updateStatus();
private: private:
static constexpr const char* rtdsOutputStreamPort = "rtds_output";
struct StatusControlRegister { uint32_t struct StatusControlRegister { uint32_t
status_ap_vld : 1, status_ap_vld : 1,
_res : 31; _res : 31;
......
...@@ -32,12 +32,16 @@ public: ...@@ -32,12 +32,16 @@ public:
{ return { registerMemory }; } { return { registerMemory }; }
const StreamVertex&
getDefaultSlavePort() const
{ return getSlavePort(rtdsInputStreamPort); }
private: private:
bool updateStatus(); bool updateStatus();
private: private:
static constexpr const char* axiInterface = "m_axi_axi_mm"; 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; XRtds2gpu xInstance;
......
...@@ -117,9 +117,8 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu") ...@@ -117,9 +117,8 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu")
dumpMem(dataDst2, dmaMemDst2.getMemoryBlock().getSize()); dumpMem(dataDst2, dmaMemDst2.getMemoryBlock().getSize());
// connect DMA to Rtds2Gpu IP // connect AXI Stream from DMA to Rtds2Gpu IP
// TODO: this should be done automatically cr_assert(dma->connect(rtds2gpu));
cr_assert(axiSwitch->connect(6, 7));
cr_assert(rtds2gpu.startOnce(dmaMemDst.getMemoryBlock(), SAMPLE_COUNT, DATA_OFFSET*4, DOORBELL_OFFSET*4), cr_assert(rtds2gpu.startOnce(dmaMemDst.getMemoryBlock(), SAMPLE_COUNT, DATA_OFFSET*4, DOORBELL_OFFSET*4),
"Preparing Rtds2Gpu IP failed"); "Preparing Rtds2Gpu IP failed");
...@@ -130,7 +129,6 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu") ...@@ -130,7 +129,6 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu")
cr_assert(dma->writeComplete(), cr_assert(dma->writeComplete(),
"DMA failed"); "DMA failed");
while(not rtds2gpu.isFinished()); while(not rtds2gpu.isFinished());
const uint32_t* doorbellDst = &dmaMemDst[DOORBELL_OFFSET]; const uint32_t* doorbellDst = &dmaMemDst[DOORBELL_OFFSET];
...@@ -139,13 +137,14 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu") ...@@ -139,13 +137,14 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu")
cr_assert(memcmp(dataSrc, dataDst, FRAME_SIZE) == 0, "Memory not equal"); cr_assert(memcmp(dataSrc, dataDst, FRAME_SIZE) == 0, "Memory not equal");
(void) dmaMemDst2;
(void) dataDst2;
for(size_t i = 0; i < SAMPLE_COUNT; i++) { for(size_t i = 0; i < SAMPLE_COUNT; i++) {
gpu2rtds->registerFrames[i] = dmaMemDst[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), cr_assert(dma->read(dmaMemDst2.getMemoryBlock(), FRAME_SIZE),
"Starting DMA S2MM transfer failed"); "Starting DMA S2MM transfer failed");
...@@ -156,7 +155,7 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu") ...@@ -156,7 +155,7 @@ Test(fpga, rtds2gpu, .description = "Rtds2Gpu")
cr_assert(dma->readComplete(), cr_assert(dma->readComplete(),
"DMA failed"); "DMA failed");
while(not rtds2gpu.isFinished()); while(not gpu2rtds->isFinished());
cr_assert(memcmp(dataSrc, dataDst2, FRAME_SIZE) == 0, "Memory not equal"); cr_assert(memcmp(dataSrc, dataDst2, FRAME_SIZE) == 0, "Memory not equal");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment