From 6b87c9bc30c09c40e828c9e7a715ca38ac421f5d Mon Sep 17 00:00:00 2001 From: Pascal Henry Bauer Date: Thu, 26 Jan 2023 17:02:25 +0100 Subject: [PATCH] refactor to use pcie card (Legacy) Signed-off-by: Pascal Henry Bauer --- fpga/include/villas/fpga/utils.hpp | 2 +- fpga/lib/ips/intc.cpp | 4 +++- fpga/lib/ips/pcie.cpp | 3 ++- fpga/tests/unit/fpga.cpp | 2 +- fpga/tests/unit/global.hpp | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fpga/include/villas/fpga/utils.hpp b/fpga/include/villas/fpga/utils.hpp index b1e9fbcf7..b4c52729d 100644 --- a/fpga/include/villas/fpga/utils.hpp +++ b/fpga/include/villas/fpga/utils.hpp @@ -9,7 +9,7 @@ #pragma once #include -#include +#include namespace villas { namespace fpga { diff --git a/fpga/lib/ips/intc.cpp b/fpga/lib/ips/intc.cpp index a314591c7..b6876fb55 100644 --- a/fpga/lib/ips/intc.cpp +++ b/fpga/lib/ips/intc.cpp @@ -14,6 +14,7 @@ #include #include +#include #include using namespace villas::fpga::ip; @@ -40,7 +41,8 @@ InterruptController::init() for (int i = 0; i < num_irqs; i++) { // Try pinning to core - int ret = kernel::setIRQAffinity(nos[i], card->affinity, nullptr); + PCIeCard* pciecard = dynamic_cast(card); + int ret = kernel::setIRQAffinity(nos[i], pciecard->affinity, nullptr); switch(ret) { case 0: diff --git a/fpga/lib/ips/pcie.cpp b/fpga/lib/ips/pcie.cpp index 7f9c840c0..c5072a625 100644 --- a/fpga/lib/ips/pcie.cpp +++ b/fpga/lib/ips/pcie.cpp @@ -12,6 +12,7 @@ #include #include +#include #include using namespace villas::fpga::ip; @@ -54,7 +55,7 @@ AxiPciExpressBridge::init() auto pciAddrSpaceId = mm.getPciAddressSpace(); - auto regions = card->pdev->getRegions(); + auto regions = dynamic_cast(card)->pdev->getRegions(); int i = 0; for (auto region : regions) { diff --git a/fpga/tests/unit/fpga.cpp b/fpga/tests/unit/fpga.cpp index ab80c2b25..b52c6e257 100644 --- a/fpga/tests/unit/fpga.cpp +++ b/fpga/tests/unit/fpga.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include "global.hpp" diff --git a/fpga/tests/unit/global.hpp b/fpga/tests/unit/global.hpp index 731a8cc13..d944363c9 100644 --- a/fpga/tests/unit/global.hpp +++ b/fpga/tests/unit/global.hpp @@ -9,7 +9,7 @@ #include -#include +#include class FpgaState { public: