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

lib/ips/fifo: fix decision if AXI4 data interface is present

This commit is contained in:
Daniel Krebs 2018-02-13 14:58:58 +01:00 committed by Steffen Vogel
parent e93b31bbf1
commit 21333379a9

View file

@ -60,10 +60,13 @@ bool Fifo::init()
XLlFifo_Config fifo_cfg;
fifo_cfg.Axi4BaseAddress = getBaseAddr(axi4Memory);
// use AXI4 for Data, AXI4-Lite for control
fifo_cfg.Datainterface = (fifo_cfg.Axi4BaseAddress != -1) ? 1 : 0;
try {
// if this throws an exception, then there's no AXI4 data interface
fifo_cfg.Axi4BaseAddress = getBaseAddr(axi4Memory);
fifo_cfg.Datainterface = 1;
} catch(const std::out_of_range&) {
fifo_cfg.Datainterface = 0;
}
if (XLlFifo_CfgInitialize(&xFifo, &fifo_cfg, getBaseAddr(registerMemory)) != XST_SUCCESS)
return false;