mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
add zynq ip
This commit is contained in:
parent
949f9048aa
commit
cbefe28793
2 changed files with 104 additions and 0 deletions
65
fpga/include/villas/fpga/ips/zynq.hpp
Normal file
65
fpga/include/villas/fpga/ips/zynq.hpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
/* Zynq node
|
||||
*
|
||||
* Author: Pascal Bauer <pascal.bauer@rwth-aachen.de>
|
||||
* SPDX-FileCopyrightText: 2023-2024 Pascal Bauer <pascal.bauer@rwth-aachen.de>
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xilinx/xaxis_switch.h>
|
||||
|
||||
#include <villas/fpga/node.hpp>
|
||||
|
||||
namespace villas {
|
||||
namespace fpga {
|
||||
namespace ip {
|
||||
|
||||
class Zynq : public Core {
|
||||
public:
|
||||
friend class ZynqFactory;
|
||||
|
||||
virtual bool init() override;
|
||||
|
||||
private:
|
||||
static constexpr char axiInterface[] = "M_AXI";
|
||||
static constexpr char pcieMemory[] = "BAR0";
|
||||
|
||||
struct AxiBar {
|
||||
uintptr_t base;
|
||||
size_t size;
|
||||
uintptr_t translation;
|
||||
};
|
||||
|
||||
struct PciBar {
|
||||
uintptr_t translation;
|
||||
};
|
||||
|
||||
std::map<std::string, AxiBar> axiToPcieTranslations;
|
||||
std::map<std::string, PciBar> pcieToAxiTranslations;
|
||||
};
|
||||
|
||||
class ZynqFactory : CoreFactory {
|
||||
|
||||
public:
|
||||
virtual std::string getName() const { return "Zynq"; }
|
||||
|
||||
virtual std::string getDescription() const {
|
||||
return "Custom platform vfio connector";
|
||||
}
|
||||
|
||||
private:
|
||||
virtual Vlnv getCompatibleVlnv() const {
|
||||
return Vlnv("xilinx.com:ip:zynq_ultra_ps_e:");
|
||||
}
|
||||
|
||||
// Create a concrete IP instance
|
||||
Core *make() const { return new Zynq; };
|
||||
|
||||
protected:
|
||||
virtual void parse(Core &, json_t *) override;
|
||||
};
|
||||
|
||||
} /* namespace ip */
|
||||
} /* namespace fpga */
|
||||
} /* namespace villas */
|
39
fpga/lib/ips/zynq.cpp
Normal file
39
fpga/lib/ips/zynq.cpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
/* Zynq VFIO connector node
|
||||
*
|
||||
* Author: Pascal Bauer <pascal.bauer@rwth-aachen.de>
|
||||
* SPDX-FileCopyrightText: 2023-2024 Pascal Bauer <pascal.bauer@rwth-aachen.de>
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <jansson.h>
|
||||
#include <limits>
|
||||
|
||||
#include <villas/exceptions.hpp>
|
||||
#include <villas/memory.hpp>
|
||||
|
||||
#include <villas/fpga/card.hpp>
|
||||
#include <villas/fpga/ips/zynq.hpp>
|
||||
#include <villas/fpga/pcie_card.hpp>
|
||||
|
||||
#include <villas/fpga/platform_card.hpp>
|
||||
|
||||
using namespace villas::fpga::ip;
|
||||
|
||||
bool Zynq::init() {
|
||||
auto &mm = MemoryManager::get();
|
||||
|
||||
// Save ID in card so we can create mappings later when needed (e.g. when
|
||||
// allocating DMA memory in host RAM)
|
||||
card->addrSpaceIdDeviceToHost =
|
||||
mm.getOrCreateAddressSpace("zynq_ultra_ps_e_0/HPC0_DDR_LOW");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ZynqFactory::parse(Core &ip, json_t *cfg) {
|
||||
CoreFactory::parse(ip, cfg);
|
||||
|
||||
auto logger = getLogger();
|
||||
}
|
||||
|
||||
static ZynqFactory p;
|
Loading…
Add table
Reference in a new issue