mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
remove some obsolete C code files
This commit is contained in:
parent
7409d2024d
commit
63a1eb2f7f
3 changed files with 0 additions and 210 deletions
|
@ -1,48 +0,0 @@
|
|||
/** GPIO related helper functions
|
||||
*
|
||||
* @author Daniel Krebs <github@daniel-krebs.net>
|
||||
* @copyright 2017-2018, Daniel Krebs
|
||||
* @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 <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include "plugin.h"
|
||||
|
||||
#include "fpga/ip.h"
|
||||
#include "fpga/card.h"
|
||||
|
||||
static int gpio_start(struct fpga_ip *c)
|
||||
{
|
||||
(void) c;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct plugin p = {
|
||||
.name = "Xilinx's GPIO controller",
|
||||
.description = "",
|
||||
.type = PLUGIN_TYPE_FPGA_IP,
|
||||
.ip = {
|
||||
.vlnv = { "xilinx.com", "ip", "axi_gpio", NULL },
|
||||
.type = FPGA_IP_TYPE_MISC,
|
||||
.start = gpio_start,
|
||||
.size = 0
|
||||
}
|
||||
};
|
||||
|
||||
REGISTER_PLUGIN(&p)
|
|
@ -1,93 +0,0 @@
|
|||
/** DMA unit test.
|
||||
*
|
||||
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
||||
* @copyright 2017-2018, 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 <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************************/
|
||||
|
||||
#include <criterion/criterion.h>
|
||||
|
||||
#include <villas/utils.h>
|
||||
|
||||
#include <villas/fpga/card.h>
|
||||
#include <villas/fpga/vlnv.h>
|
||||
#include <villas/fpga/ip.h>
|
||||
#include <villas/fpga/ips/dma.h>
|
||||
|
||||
#include <villas/log.h>
|
||||
#include <villas/list.h>
|
||||
|
||||
extern struct fpga_card *card;
|
||||
|
||||
Test(fpga, dma, .description = "DMA")
|
||||
{
|
||||
int ret = -1;
|
||||
struct dma_mem mem, src, dst;
|
||||
|
||||
for (size_t i = 0; i < list_length(&card->ips); i++) { INDENT
|
||||
struct fpga_ip *dm = (struct fpga_ip *) list_at(&card->ips, i);
|
||||
|
||||
if (fpga_vlnv_cmp(&dm->vlnv, &(struct fpga_vlnv) { "xilinx.com", "ip", "axi_dma", NULL }))
|
||||
continue; /* skip non DMA IP cores */
|
||||
|
||||
struct dma *dma = (struct dma *) dm->_vd;
|
||||
|
||||
/* Simple DMA can only transfer up to 4 kb due to
|
||||
* PCIe page size burst limitation */
|
||||
ssize_t len2, len = dma->inst.HasSg ? 64 << 20 : 1 << 12;
|
||||
|
||||
ret = dma_alloc(dm, &mem, 2 * len, 0);
|
||||
cr_assert_eq(ret, 0);
|
||||
|
||||
ret = dma_mem_split(&mem, &src, &dst);
|
||||
cr_assert_eq(ret, 0);
|
||||
|
||||
/* Get new random data */
|
||||
len2 = read_random(src.base_virt, len);
|
||||
if (len2 != len)
|
||||
serror("Failed to get random data");
|
||||
|
||||
int irq_mm2s = dm->irq;
|
||||
int irq_s2mm = dm->irq + 1;
|
||||
|
||||
ret = intc_enable(card->intc, (1 << irq_mm2s) | (1 << irq_s2mm), 0);
|
||||
cr_assert_eq(ret, 0, "Failed to enable interrupt");
|
||||
|
||||
ret = switch_connect(card->sw, dm, dm);
|
||||
cr_assert_eq(ret, 0, "Failed to configure switch");
|
||||
|
||||
/* Start transfer */
|
||||
ret = dma_ping_pong(dm, src.base_phys, dst.base_phys, dst.len);
|
||||
cr_assert_eq(ret, 0, "DMA ping pong failed");
|
||||
|
||||
ret = memcmp(src.base_virt, dst.base_virt, src.len);
|
||||
|
||||
info("DMA %s (%s): %s", dm->name, dma->inst.HasSg ? "scatter-gather" : "simple", ret ? CLR_RED("failed") : CLR_GRN("passed"));
|
||||
|
||||
ret = switch_disconnect(card->sw, dm, dm);
|
||||
cr_assert_eq(ret, 0, "Failed to configure switch");
|
||||
|
||||
ret = intc_disable(card->intc, (1 << irq_mm2s) | (1 << irq_s2mm));
|
||||
cr_assert_eq(ret, 0, "Failed to disable interrupt");
|
||||
|
||||
ret = dma_free(dm, &mem);
|
||||
cr_assert_eq(ret, 0, "Failed to release DMA memory");
|
||||
}
|
||||
|
||||
cr_assert_eq(ret, 0);
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
/** Timer/Counter unit test.
|
||||
*
|
||||
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
||||
* @copyright 2017-2018, 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 <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************************/
|
||||
|
||||
#include <criterion/criterion.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <villas/log.h>
|
||||
|
||||
#include <villas/fpga/card.h>
|
||||
#include <villas/fpga/vlnv.h>
|
||||
#include <villas/fpga/ip.h>
|
||||
|
||||
#include <villas/fpga/ips/timer.h>
|
||||
|
||||
extern struct fpga_card *card;
|
||||
|
||||
Test(fpga, timer, .description = "Timer Counter")
|
||||
{
|
||||
int ret;
|
||||
struct fpga_ip *ip;
|
||||
struct timer *tmr;
|
||||
|
||||
ip = fpga_vlnv_lookup(&card->ips, &(struct fpga_vlnv) { "xilinx.com", "ip", "axi_timer", NULL });
|
||||
cr_assert(ip);
|
||||
|
||||
tmr = (struct timer *) ip->_vd;
|
||||
|
||||
XTmrCtr *xtmr = &tmr->inst;
|
||||
|
||||
ret = intc_enable(card->intc, (1 << ip->irq), 0);
|
||||
cr_assert_eq(ret, 0, "Failed to enable interrupt");
|
||||
|
||||
XTmrCtr_SetOptions(xtmr, 0, XTC_EXT_COMPARE_OPTION | XTC_DOWN_COUNT_OPTION);
|
||||
XTmrCtr_SetResetValue(xtmr, 0, FPGA_AXI_HZ / 125);
|
||||
XTmrCtr_Start(xtmr, 0);
|
||||
|
||||
uint64_t counter = intc_wait(card->intc, ip->irq);
|
||||
info("Got IRQ: counter = %ju", counter);
|
||||
|
||||
if (counter == 1)
|
||||
return;
|
||||
else
|
||||
warn("Counter was not 1");
|
||||
|
||||
intc_disable(card->intc, (1 << ip->irq));
|
||||
cr_assert_eq(ret, 0, "Failed to disable interrupt");
|
||||
|
||||
return;
|
||||
}
|
Loading…
Add table
Reference in a new issue