mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Debug update
This commit is contained in:
parent
3326c83fc7
commit
bf74db8e79
5 changed files with 12 additions and 18 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 9747c6ead6dedff943dbf22ce74e40e9b2622514
|
||||
Subproject commit 01f88dd58e7a6ed5b21d54c956d66d2774e09c3d
|
|
@ -119,7 +119,7 @@ protected:
|
|||
SpdLogger logger;
|
||||
};
|
||||
|
||||
using CardList = std::list<std::unique_ptr<PCIeCard>>;
|
||||
using CardList = std::list<std::shared_ptr<PCIeCard>>;
|
||||
|
||||
class PCIeCardFactory : public Plugin {
|
||||
public:
|
||||
|
|
|
@ -89,7 +89,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)
|
||||
|
|
|
@ -63,7 +63,7 @@ void setupColorHandling()
|
|||
std::atexit([](){std::cout << rang::style::reset;});
|
||||
}
|
||||
|
||||
fpga::PCIeCard&
|
||||
std::shared_ptr<fpga::PCIeCard>
|
||||
setupFpgaCard(const std::string& configFile, const std::string& fpgaName)
|
||||
{
|
||||
if(pci_init(&pci) != 0) {
|
||||
|
@ -107,24 +107,19 @@ setupFpgaCard(const std::string& configFile, const std::string& fpgaName)
|
|||
|
||||
// create all FPGA card instances using the corresponding plugin
|
||||
auto cards = fpgaCardPlugin->make(fpgas, &pci, vfioContainer);
|
||||
villas::fpga::PCIeCard* card = nullptr;
|
||||
|
||||
for(auto& fpgaCard : cards) {
|
||||
if(fpgaCard->name == fpgaName) {
|
||||
card = fpgaCard.get();
|
||||
break;
|
||||
return fpgaCard;
|
||||
}
|
||||
}
|
||||
|
||||
if(card == nullptr) {
|
||||
logger->error("FPGA card {} not found in config or not working", fpgaName);
|
||||
exit(1);
|
||||
}
|
||||
logger->error("FPGA card {} not found in config or not working", fpgaName);
|
||||
|
||||
// deallocate JSON config
|
||||
// json_decref(json);
|
||||
|
||||
return *card;
|
||||
return std::shared_ptr<villas::fpga::PCIeCard>();
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
|
@ -150,16 +145,16 @@ int main(int argc, char* argv[])
|
|||
spdlog::set_level(spdlog::level::debug);
|
||||
setupColorHandling();
|
||||
|
||||
fpga::PCIeCard& card = setupFpgaCard(configFile, fpgaName);
|
||||
auto card = setupFpgaCard(configFile, fpgaName);
|
||||
|
||||
auto rtds = reinterpret_cast<fpga::ip::Rtds*>
|
||||
(card.lookupIp(fpga::Vlnv("acs.eonerc.rwth-aachen.de:user:rtds_axis:")));
|
||||
(card->lookupIp(fpga::Vlnv("acs.eonerc.rwth-aachen.de:user:rtds_axis:")));
|
||||
|
||||
auto dma = reinterpret_cast<fpga::ip::Dma*>
|
||||
(card.lookupIp(fpga::Vlnv("xilinx.com:ip:axi_dma:")));
|
||||
(card->lookupIp(fpga::Vlnv("xilinx.com:ip:axi_dma:")));
|
||||
|
||||
auto fifo = reinterpret_cast<fpga::ip::Fifo*>
|
||||
(card.lookupIp(fpga::Vlnv("xilinx.com:ip:axi_fifo_mm_s:")));
|
||||
(card->lookupIp(fpga::Vlnv("xilinx.com:ip:axi_fifo_mm_s:")));
|
||||
|
||||
if(rtds == nullptr) {
|
||||
logger->error("No RTDS interface found on FPGA");
|
||||
|
|
|
@ -27,7 +27,6 @@ set(SOURCES
|
|||
dma.cpp
|
||||
fifo.cpp
|
||||
rtds.cpp
|
||||
rtds2gpu.cpp
|
||||
timer.cpp
|
||||
)
|
||||
|
||||
|
@ -36,7 +35,7 @@ add_executable(unit-tests ${SOURCES})
|
|||
if(CMAKE_CUDA_COMPILER)
|
||||
enable_language(CUDA)
|
||||
target_sources(unit-tests PRIVATE
|
||||
gpu.cpp gpu_kernels.cu)
|
||||
gpu.cpp rtds2gpu.cpp gpu_kernels.cu)
|
||||
endif()
|
||||
|
||||
find_package(Criterion REQUIRED)
|
||||
|
|
Loading…
Add table
Reference in a new issue