From 77b55f65f7465f836a342663389244c1a8f7475a Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 11 Jun 2020 18:19:03 +0200 Subject: [PATCH] use new plugin mechanism --- fpga/common | 2 +- fpga/include/villas/fpga/card.hpp | 11 ++++++++--- fpga/include/villas/fpga/ip.hpp | 2 -- fpga/include/villas/fpga/ips/aurora.hpp | 8 ++++---- fpga/include/villas/fpga/ips/bram.hpp | 11 ++++------- fpga/include/villas/fpga/ips/dma.hpp | 8 ++++---- fpga/include/villas/fpga/ips/fifo.hpp | 9 ++++----- fpga/include/villas/fpga/ips/gpio.hpp | 11 ++++------- fpga/include/villas/fpga/ips/gpu2rtds.hpp | 8 ++++---- fpga/include/villas/fpga/ips/intc.hpp | 11 ++++------- fpga/include/villas/fpga/ips/pcie.hpp | 11 ++++++----- fpga/include/villas/fpga/ips/rtds.hpp | 11 +++++------ fpga/include/villas/fpga/ips/rtds2gpu.hpp | 8 ++++---- fpga/include/villas/fpga/ips/switch.hpp | 11 ++++++----- fpga/include/villas/fpga/ips/timer.hpp | 11 ++++------- fpga/lib/ips/aurora.cpp | 5 ----- fpga/lib/ips/dma.cpp | 9 +-------- fpga/lib/ips/fifo.cpp | 13 ------------- fpga/lib/ips/rtds.cpp | 5 ----- fpga/lib/ips/rtds2gpu/gpu2rtds.cpp | 5 ----- fpga/lib/ips/rtds2gpu/rtds2gpu.cpp | 5 ----- 21 files changed, 63 insertions(+), 112 deletions(-) diff --git a/fpga/common b/fpga/common index 507132784..1ddb51d71 160000 --- a/fpga/common +++ b/fpga/common @@ -1 +1 @@ -Subproject commit 5071327844fd93de6d44ce9e47459a41b9bd17cb +Subproject commit 1ddb51d71d13295a76b06a10593102659227f972 diff --git a/fpga/include/villas/fpga/card.hpp b/fpga/include/villas/fpga/card.hpp index 6190f041d..b40a564d7 100644 --- a/fpga/include/villas/fpga/card.hpp +++ b/fpga/include/villas/fpga/card.hpp @@ -124,9 +124,6 @@ using CardList = std::list>; class PCIeCardFactory : public plugin::Plugin { public: - PCIeCardFactory() : - Plugin("pcie", "Xilinx PCIe FPGA cards") {} - static CardList make(json_t *json, struct pci* pci, std::shared_ptr vc); @@ -136,6 +133,14 @@ public: static Logger getStaticLogger() { return villas::logging.get("PCIeCardFactory"); } + + virtual std::string + getName() const + { return "pcie"; } + + virtual std::string + getDescription() const + { return "Xilinx PCIe FPGA cards"; } }; } /* namespace fpga */ diff --git a/fpga/include/villas/fpga/ip.hpp b/fpga/include/villas/fpga/ip.hpp index 1840e7308..15121ce1c 100644 --- a/fpga/include/villas/fpga/ip.hpp +++ b/fpga/include/villas/fpga/ip.hpp @@ -257,8 +257,6 @@ private: { return true; } virtual Vlnv getCompatibleVlnv() const = 0; - virtual std::string getName() const = 0; - virtual std::string getDescription() const = 0; protected: static Logger diff --git a/fpga/include/villas/fpga/ips/aurora.hpp b/fpga/include/villas/fpga/ips/aurora.hpp index 10e55a0f7..c7e1c621d 100644 --- a/fpga/include/villas/fpga/ips/aurora.hpp +++ b/fpga/include/villas/fpga/ips/aurora.hpp @@ -64,20 +64,20 @@ private: class AuroraFactory : public IpNodeFactory { public: - AuroraFactory(); IpCore* create() { return new Aurora; } - std::string + virtual std::string getName() const { return "Aurora"; } - std::string + virtual std::string getDescription() const { return "Aurora 8B/10B and additional support modules, like an AXI4-Lite register interface."; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return {"acs.eonerc.rwth-aachen.de:user:aurora_axis:"}; } }; diff --git a/fpga/include/villas/fpga/ips/bram.hpp b/fpga/include/villas/fpga/ips/bram.hpp index 6323ab5bc..a123bcc73 100644 --- a/fpga/include/villas/fpga/ips/bram.hpp +++ b/fpga/include/villas/fpga/ips/bram.hpp @@ -59,24 +59,21 @@ private: class BramFactory : public IpCoreFactory { public: - BramFactory() : - IpCoreFactory(getName(), getDescription()) - {} - bool configureJson(IpCore& ip, json_t *json_ip); IpCore* create() { return new Bram; } - std::string + virtual std::string getName() const { return "Bram"; } - std::string + virtual std::string getDescription() const { return "Block RAM"; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return {"xilinx.com:ip:axi_bram_ctrl:"}; } }; diff --git a/fpga/include/villas/fpga/ips/dma.hpp b/fpga/include/villas/fpga/ips/dma.hpp index 2b9040a56..064f7dbf6 100644 --- a/fpga/include/villas/fpga/ips/dma.hpp +++ b/fpga/include/villas/fpga/ips/dma.hpp @@ -113,20 +113,20 @@ private: class DmaFactory : public IpNodeFactory { public: - DmaFactory(); IpCore* create() { return new Dma; } - std::string + virtual std::string getName() const { return "Dma"; } - std::string + virtual std::string getDescription() const { return "Xilinx's AXI4 Direct Memory Access Controller"; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return {"xilinx.com:ip:axi_dma:"}; } }; diff --git a/fpga/include/villas/fpga/ips/fifo.hpp b/fpga/include/villas/fpga/ips/fifo.hpp index 754aa96c4..3f025f2ec 100644 --- a/fpga/include/villas/fpga/ips/fifo.hpp +++ b/fpga/include/villas/fpga/ips/fifo.hpp @@ -65,7 +65,6 @@ private: class FifoFactory : public IpNodeFactory { public: - FifoFactory(); IpCore* create() { return new Fifo; } @@ -90,20 +89,20 @@ class FifoData : public IpNode { class FifoDataFactory : public IpNodeFactory { public: - FifoDataFactory(); IpCore* create() { return new FifoData; } - std::string + virtual std::string getName() const { return "FifoData"; } - std::string + virtual std::string getDescription() const { return "Xilinx's AXI4 data stream FIFO"; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return {"xilinx.com:ip:axis_data_fifo:"}; } }; diff --git a/fpga/include/villas/fpga/ips/gpio.hpp b/fpga/include/villas/fpga/ips/gpio.hpp index 745d29248..19beb329d 100644 --- a/fpga/include/villas/fpga/ips/gpio.hpp +++ b/fpga/include/villas/fpga/ips/gpio.hpp @@ -54,10 +54,6 @@ private: class GeneralPurposeIOFactory : public IpCoreFactory { public: - GeneralPurposeIOFactory() : - IpCoreFactory(getName(), getDescription()) - {} - static constexpr const char* getCompatibleVlnvString() { return "xilinx.com:ip:axi_gpio:"; } @@ -65,15 +61,16 @@ public: IpCore* create() { return new GeneralPurposeIO; } - std::string + virtual std::string getName() const { return "GeneralPurposeIO"; } - std::string + virtual std::string getDescription() const { return "Xilinx's AXI4 general purpose IO"; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return Vlnv(getCompatibleVlnvString()); } }; diff --git a/fpga/include/villas/fpga/ips/gpu2rtds.hpp b/fpga/include/villas/fpga/ips/gpu2rtds.hpp index 1904a7c21..b4622ef4b 100644 --- a/fpga/include/villas/fpga/ips/gpu2rtds.hpp +++ b/fpga/include/villas/fpga/ips/gpu2rtds.hpp @@ -65,20 +65,20 @@ public: class Gpu2RtdsFactory : public IpNodeFactory { public: - Gpu2RtdsFactory(); IpCore* create() { return new Gpu2Rtds; } - std::string + virtual std::string getName() const { return "Gpu2Rtds"; } - std::string + virtual std::string getDescription() const { return "HLS Gpu2Rtds IP"; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return {"acs.eonerc.rwth-aachen.de:hls:gpu2rtds:"}; } }; diff --git a/fpga/include/villas/fpga/ips/intc.hpp b/fpga/include/villas/fpga/ips/intc.hpp index 56f0cc63d..6c68e5137 100644 --- a/fpga/include/villas/fpga/ips/intc.hpp +++ b/fpga/include/villas/fpga/ips/intc.hpp @@ -84,10 +84,6 @@ private: class InterruptControllerFactory : public IpCoreFactory { public: - InterruptControllerFactory() : - IpCoreFactory(getName(), getDescription()) - {} - static constexpr const char* getCompatibleVlnvString() { return "acs.eonerc.rwth-aachen.de:user:axi_pcie_intc:"; } @@ -95,15 +91,16 @@ public: IpCore* create() { return new InterruptController; } - std::string + virtual std::string getName() const { return "InterruptController"; } - std::string + virtual std::string getDescription() const { return "Xilinx's programmable interrupt controller"; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return Vlnv(getCompatibleVlnvString()); } }; diff --git a/fpga/include/villas/fpga/ips/pcie.hpp b/fpga/include/villas/fpga/ips/pcie.hpp index 48c6765eb..538fe0371 100644 --- a/fpga/include/villas/fpga/ips/pcie.hpp +++ b/fpga/include/villas/fpga/ips/pcie.hpp @@ -65,8 +65,6 @@ private: class AxiPciExpressBridgeFactory : public IpCoreFactory { public: - AxiPciExpressBridgeFactory() : - IpCoreFactory(getName(), getDescription()) {} static constexpr const char* getCompatibleVlnvString() @@ -77,13 +75,16 @@ public: IpCore* create() { return new AxiPciExpressBridge; } - std::string getName() const + virtual std::string + getName() const { return "AxiPciExpressBridge"; } - std::string getDescription() const + virtual std::string + getDescription() const { return "Xilinx's AXI-PCIe Bridge"; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return Vlnv(getCompatibleVlnvString()); } }; diff --git a/fpga/include/villas/fpga/ips/rtds.hpp b/fpga/include/villas/fpga/ips/rtds.hpp index 567369e98..81d8967fb 100644 --- a/fpga/include/villas/fpga/ips/rtds.hpp +++ b/fpga/include/villas/fpga/ips/rtds.hpp @@ -62,20 +62,19 @@ private: class RtdsFactory : public IpNodeFactory { public: - RtdsFactory(); - IpCore* create() { return new Rtds; } - std::string + virtual std::string getName() const - { return "Rtds"; } + { return "rtds"; } - std::string + virtual std::string getDescription() const { return "RTDS's AXI4-Stream - GTFPGA interface"; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return {"acs.eonerc.rwth-aachen.de:user:rtds_axis:"}; } }; diff --git a/fpga/include/villas/fpga/ips/rtds2gpu.hpp b/fpga/include/villas/fpga/ips/rtds2gpu.hpp index ce5938cd6..cedd41bee 100644 --- a/fpga/include/villas/fpga/ips/rtds2gpu.hpp +++ b/fpga/include/villas/fpga/ips/rtds2gpu.hpp @@ -74,20 +74,20 @@ private: class Rtds2GpuFactory : public IpNodeFactory { public: - Rtds2GpuFactory(); IpCore* create() { return new Rtds2Gpu; } - std::string + virtual std::string getName() const { return "Rtds2Gpu"; } - std::string + virtual std::string getDescription() const { return "HLS RTDS2GPU IP"; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return {"acs.eonerc.rwth-aachen.de:hls:rtds2gpu:"}; } }; diff --git a/fpga/include/villas/fpga/ips/switch.hpp b/fpga/include/villas/fpga/ips/switch.hpp index 66c4e4801..233edce79 100644 --- a/fpga/include/villas/fpga/ips/switch.hpp +++ b/fpga/include/villas/fpga/ips/switch.hpp @@ -72,8 +72,6 @@ private: class AxiStreamSwitchFactory : public IpNodeFactory { public: - AxiStreamSwitchFactory() : - IpNodeFactory(getName(), getDescription()) {} static constexpr const char* getCompatibleVlnvString() @@ -84,13 +82,16 @@ public: IpCore* create() { return new AxiStreamSwitch; } - std::string getName() const + virtual std::string + getName() const { return "AxiStreamSwitch"; } - std::string getDescription() const + virtual std::string + getDescription() const { return "Xilinx's AXI4-Stream switch"; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return Vlnv(getCompatibleVlnvString()); } }; diff --git a/fpga/include/villas/fpga/ips/timer.hpp b/fpga/include/villas/fpga/ips/timer.hpp index bc8cba0d0..1856af260 100644 --- a/fpga/include/villas/fpga/ips/timer.hpp +++ b/fpga/include/villas/fpga/ips/timer.hpp @@ -76,22 +76,19 @@ private: class TimerFactory : public IpCoreFactory { public: - TimerFactory() : - IpCoreFactory(getName(), getDescription()) - {} - IpCore* create() { return new Timer; } - std::string + virtual std::string getName() const { return "Timer"; } - std::string + virtual std::string getDescription() const { return "Xilinx's programmable timer / counter"; } - Vlnv getCompatibleVlnv() const + virtual Vlnv + getCompatibleVlnv() const { return {"xilinx.com:ip:axi_timer:"}; } }; diff --git a/fpga/lib/ips/aurora.cpp b/fpga/lib/ips/aurora.cpp index 8bd41187f..4b80f7809 100644 --- a/fpga/lib/ips/aurora.cpp +++ b/fpga/lib/ips/aurora.cpp @@ -119,11 +119,6 @@ void Aurora::resetFrameCounters() writeMemory(registerMemory, AURORA_AXIS_CR_OFFSET, cr); } -AuroraFactory::AuroraFactory() : - IpNodeFactory(getName(), getDescription()) -{ -} - } // namespace ip } // namespace fpga } // namespace villas diff --git a/fpga/lib/ips/dma.cpp b/fpga/lib/ips/dma.cpp index ba72e8f53..9fbc8cf9d 100644 --- a/fpga/lib/ips/dma.cpp +++ b/fpga/lib/ips/dma.cpp @@ -42,13 +42,6 @@ namespace ip { // instantiate factory to make available to plugin infrastructure static DmaFactory factory; -DmaFactory::DmaFactory() : - IpNodeFactory(getName(), getDescription()) -{ - // nothing to do -} - - bool Dma::init() { @@ -89,7 +82,7 @@ Dma::init() /* Map buffer descriptors */ if (hasScatterGather()) { logger->warn("Scatter Gather not yet implemented"); -// return false; + return false; // ret = dma_alloc(c, &dma->bd, FPGA_DMA_BD_SIZE, 0); // if (ret) diff --git a/fpga/lib/ips/fifo.cpp b/fpga/lib/ips/fifo.cpp index 18b33028d..d280e4562 100644 --- a/fpga/lib/ips/fifo.cpp +++ b/fpga/lib/ips/fifo.cpp @@ -41,19 +41,6 @@ static FifoFactory factory; static FifoDataFactory factoryData; -FifoFactory::FifoFactory() : - IpNodeFactory(getName(), getDescription()) -{ - // nothing to do -} - -FifoDataFactory::FifoDataFactory() : - IpNodeFactory(getName(), getDescription()) -{ - // nothing to do -} - - bool Fifo::init() { XLlFifo_Config fifo_cfg; diff --git a/fpga/lib/ips/rtds.cpp b/fpga/lib/ips/rtds.cpp index e2ed4c117..c0061f575 100644 --- a/fpga/lib/ips/rtds.cpp +++ b/fpga/lib/ips/rtds.cpp @@ -92,11 +92,6 @@ double Rtds::getDt() return (dt == 0xFFFF) ? 0.0 : (double) dt / RTDS_HZ; } -RtdsFactory::RtdsFactory() : - IpNodeFactory(getName(), getDescription()) -{ -} - } // namespace ip } // namespace fpga } // namespace villas diff --git a/fpga/lib/ips/rtds2gpu/gpu2rtds.cpp b/fpga/lib/ips/rtds2gpu/gpu2rtds.cpp index a1f58d00d..7239cef71 100644 --- a/fpga/lib/ips/rtds2gpu/gpu2rtds.cpp +++ b/fpga/lib/ips/rtds2gpu/gpu2rtds.cpp @@ -131,11 +131,6 @@ Gpu2Rtds::getMaxFrameSize() // logger->info(" Seq. number: {}", doorbell.seq_nr); //} -Gpu2RtdsFactory::Gpu2RtdsFactory() : - IpNodeFactory(getName(), getDescription()) -{ -} - } // namespace ip } // namespace fpga } // namespace villas diff --git a/fpga/lib/ips/rtds2gpu/rtds2gpu.cpp b/fpga/lib/ips/rtds2gpu/rtds2gpu.cpp index a7902512a..19eb94dcb 100644 --- a/fpga/lib/ips/rtds2gpu/rtds2gpu.cpp +++ b/fpga/lib/ips/rtds2gpu/rtds2gpu.cpp @@ -116,11 +116,6 @@ Rtds2Gpu::dumpDoorbell(uint32_t doorbellRegister) const logger->info(" Seq. number: {}", doorbell.seq_nr); } -Rtds2GpuFactory::Rtds2GpuFactory() : - IpNodeFactory(getName(), getDescription()) -{ -} - } // namespace ip } // namespace fpga } // namespace villas