From 9676a9535ddae8c696a8278b50307489e23bc07f Mon Sep 17 00:00:00 2001 From: daniel-k Date: Thu, 21 Dec 2017 21:18:52 +0100 Subject: [PATCH] lib/ip: re-add IRQ to IpCore --- fpga/include/villas/fpga/ip.hpp | 7 +++---- fpga/lib/ip.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/fpga/include/villas/fpga/ip.hpp b/fpga/include/villas/fpga/ip.hpp index 8da572d7e..33f78a904 100644 --- a/fpga/include/villas/fpga/ip.hpp +++ b/fpga/include/villas/fpga/ip.hpp @@ -75,7 +75,7 @@ public: friend IpCoreFactory; - IpCore() : card(nullptr), baseaddr(0) {} //, irq(-1), port(-1) {} + IpCore() : card(nullptr), baseaddr(0), irq(-1) {} virtual ~IpCore() {} // IPs can implement this interface @@ -108,10 +108,9 @@ protected: protected: // populated by FpgaIpFactory PCIeCard* card; /**< FPGA card this IP is instantiated on */ - IpIdentifier id; /**< VLNV and name defined in JSON config */ + IpIdentifier id; /**< VLNV and name defined in JSON config */ uintptr_t baseaddr; /**< The baseadress of this FPGA IP component */ -// int irq; /**< The interrupt number of the FPGA IP component. */ -// int port; /**< The port of the AXI4-Stream switch to which this FPGA IP component is connected. */ + int irq; /**< The interrupt number of the FPGA IP component. */ std::map dependencies; }; diff --git a/fpga/lib/ip.cpp b/fpga/lib/ip.cpp index b8e020ba1..6fef6270e 100644 --- a/fpga/lib/ip.cpp +++ b/fpga/lib/ip.cpp @@ -227,10 +227,10 @@ IpCoreFactory::make(PCIeCard* card, json_t *json_ips) ip->id = id; // extract some optional properties - int ret = json_unpack(json_ip, "{ s?: i}", //, s?: i, s?: i }", - "baseaddr", &ip->baseaddr); - // "irq", &ip->irq, - // "port", &ip->port); + int ret = json_unpack(json_ip, "{ s?: i, s?: i }", + "baseaddr", &ip->baseaddr, // required + "irq", &ip->irq); // optional + if(ret != 0) { cpp_warn << "Problem while parsing JSON for IP " << TXT_BOLD(ipName);