From 08114652d6a81bf955a67b0777b6385f9b086030 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 8 Jul 2020 15:20:05 +0200 Subject: [PATCH] emc: add stub IP --- fpga/include/villas/fpga/ips/emc.hpp | 78 +++++++++++++++++++++++++++ fpga/include/villas/fpga/ips/gpio.hpp | 2 - fpga/include/villas/fpga/ips/hls.hpp | 23 ++++++++ fpga/lib/CMakeLists.txt | 1 + fpga/lib/ips/emc.cpp | 40 ++++++++++++++ fpga/lib/ips/gpio.cpp | 7 --- 6 files changed, 142 insertions(+), 9 deletions(-) create mode 100644 fpga/include/villas/fpga/ips/emc.hpp create mode 100644 fpga/lib/ips/emc.cpp diff --git a/fpga/include/villas/fpga/ips/emc.hpp b/fpga/include/villas/fpga/ips/emc.hpp new file mode 100644 index 000000000..490d1e61e --- /dev/null +++ b/fpga/include/villas/fpga/ips/emc.hpp @@ -0,0 +1,78 @@ +/** AXI External Memory Controller (EMC) + * + * @file + * @author Steffen Vogel + * @copyright 2017-2020, Steffen Vogel + * @license GNU General Public License (version 3) + * + * VILLASfpga + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *********************************************************************************/ + +/** @addtogroup fpga VILLASfpga + * @{ + */ + +#pragma once + +#include + +namespace villas { +namespace fpga { +namespace ip { + + +class EMC : public Core +{ +public: + + bool init(); + +private: + + static constexpr char registerMemory[] = "Reg"; + + std::list getMemoryBlocks() const + { return { registerMemory }; } +}; + +class EMCFactory : public CoreFactory { +public: + + static constexpr const char* + getCompatibleVlnvString() + { return "xilinx.com:ip:axi_emc:"; } + + Core* create() + { return new EMC; } + + virtual std::string + getName() const + { return "ExternalMemoryController"; } + + virtual std::string + getDescription() const + { return "Xilinx's AXI External Memory Controller (EMC) "; } + + virtual Vlnv + getCompatibleVlnv() const + { return Vlnv(getCompatibleVlnvString()); } +}; + +} /* namespace ip */ +} /* namespace fpga */ +} /* namespace villas */ + +/** @} */ diff --git a/fpga/include/villas/fpga/ips/gpio.hpp b/fpga/include/villas/fpga/ips/gpio.hpp index ffa695626..6d22d9e1d 100644 --- a/fpga/include/villas/fpga/ips/gpio.hpp +++ b/fpga/include/villas/fpga/ips/gpio.hpp @@ -28,8 +28,6 @@ #pragma once -#include - #include namespace villas { diff --git a/fpga/include/villas/fpga/ips/hls.hpp b/fpga/include/villas/fpga/ips/hls.hpp index b7ded443e..c46649a95 100644 --- a/fpga/include/villas/fpga/ips/hls.hpp +++ b/fpga/include/villas/fpga/ips/hls.hpp @@ -132,6 +132,29 @@ protected: bool running; }; +class HlsFactory : public CoreFactory { +public: + + static constexpr const char* + getCompatibleVlnvString() + { return "acs.eonerc.rwth-aachen.de:hls:"; } + + Core* create() + { return new Hls; } + + virtual std::string + getName() const + { return "HighLevelSynthesis"; } + + virtual std::string + getDescription() const + { return "Xilinx's HLS IP Cores"; } + + virtual Vlnv + getCompatibleVlnv() const + { return Vlnv(getCompatibleVlnvString()); } +}; + } /* namespace ip */ } /* namespace fpga */ } /* namespace villas */ diff --git a/fpga/lib/CMakeLists.txt b/fpga/lib/CMakeLists.txt index c22f299e9..f3b69a930 100644 --- a/fpga/lib/CMakeLists.txt +++ b/fpga/lib/CMakeLists.txt @@ -28,6 +28,7 @@ set(SOURCES ips/timer.cpp ips/switch.cpp + ips/emc.cpp ips/fifo.cpp ips/intc.cpp ips/pcie.cpp diff --git a/fpga/lib/ips/emc.cpp b/fpga/lib/ips/emc.cpp new file mode 100644 index 000000000..94e7e6418 --- /dev/null +++ b/fpga/lib/ips/emc.cpp @@ -0,0 +1,40 @@ +/** AXI External Memory Controller (EMC) + * + * @author Steffen Vogel + * @copyright 2017-2020, Steffen Vogel + * @license GNU General Public License (version 3) + * + * VILLASfpga + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *********************************************************************************/ + +#include + +#include + +using namespace villas::fpga::ip; + + +// instantiate factory to make available to plugin infrastructure +static EMCFactory factory; + +bool +EMC::init() +{ + //const uintptr_t base = getBaseAddr(registerMemory); + + return true; +} + diff --git a/fpga/lib/ips/gpio.cpp b/fpga/lib/ips/gpio.cpp index 37b10ce16..a3d3931fb 100644 --- a/fpga/lib/ips/gpio.cpp +++ b/fpga/lib/ips/gpio.cpp @@ -20,15 +20,8 @@ * along with this program. If not, see . *********************************************************************************/ -#include -#include - -#include #include -#include - -#include #include using namespace villas::fpga::ip;