Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 8f78034

Browse files
committed
imported source code from VILLASfpga repo and made it compile
1 parent c8db2e0 commit 8f78034

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+16455
-0
lines changed

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Matches multiple files with brace expansion notation
12+
# Set default charset
13+
[{etc,include,lib,plugins,src,tests,tools}/**.{c,h}]
14+
charset = utf-8
15+
indent_style = tab
16+
indent_size = 8
17+
trim_trailing_whitespace=true

.gitlab-ci.yml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
variables:
2+
GIT_STRATEGY: fetch
3+
GIT_SUBMODULE_STRATEGY: recursive
4+
PREFIX: /usr/
5+
DOCKER_TAG_DEV: ${CI_COMMIT_REF_NAME}
6+
DOCKER_IMAGE_DEV: villas/fpga-dev
7+
8+
stages:
9+
- prepare
10+
- build
11+
- test
12+
- deploy
13+
- docker
14+
15+
# For some reason, GitLab CI prunes the contents of the submodules so we need to restore them.
16+
before_script:
17+
- git submodule foreach git checkout .
18+
19+
# Stage: prepare
20+
##############################################################################
21+
22+
# Build docker image which is used to build & test VILLASnode
23+
docker-dev:
24+
stage: prepare
25+
script:
26+
- docker build -t ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV} .
27+
tags:
28+
- shell
29+
- linux
30+
31+
# Stage: build
32+
##############################################################################
33+
34+
build:source:
35+
stage: build
36+
script:
37+
- mkdir build && cd build && cmake .. && make
38+
artifacts:
39+
expire_in: 1 week
40+
name: ${CI_PROJECT_NAME}-${CI_BUILD_REF}
41+
paths:
42+
- build/
43+
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
44+
tags:
45+
- docker
46+
47+
#build:packages:
48+
# stage: build
49+
# script:
50+
# - mkdir build && cd build && cmake .. && make package
51+
# artifacts:
52+
# expire_in: 1 week
53+
# name: ${CI_PROJECT_NAME}-${CI_BUILD_REF}
54+
# paths:
55+
# - build/
56+
# image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
57+
# tags:
58+
# - docker
59+
60+
# Stage: test
61+
##############################################################################
62+
63+
#test:unit:
64+
# stage: test
65+
# dependencies:
66+
# - build:source
67+
# script:
68+
# - make test
69+
# image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG_DEV}
70+
# tags:
71+
# - docker
72+
# - fpga
73+
74+
# Stage: deploy
75+
##############################################################################
76+
77+
#deploy:packages:
78+
# stage: deploy
79+
# script:
80+
# - ssh ${DEPLOY_USER}@${DEPLOY_HOST} mkdir -p ${DEPLOY_PATH}/{dist,../packages}
81+
# - rsync ${RSYNC_OPTS} build/*.rpm ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/../packages/
82+
# - rsync ${RSYNC_OPTS} build//*.tar.gz ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}/dist/
83+
# - ssh ${DEPLOY_USER}@${DEPLOY_HOST} createrepo ${DEPLOY_PATH}/../packages
84+
# dependencies:
85+
# - build:packages
86+
# tags:
87+
# - villas-deploy
88+
# only:
89+
# - tags
90+
#
91+
#deploy:git-mirror:
92+
# stage: deploy
93+
# script:
94+
# - git push --force --mirror --prune https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com:VILLASframework/VILLASnode.git

CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
3+
project(VILLASfpga C)
4+
5+
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
6+
7+
add_subdirectory(lib)
8+
add_subdirectory(tests)

cmake/FindCriterion.cmake

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This file is licensed under the WTFPL version 2 -- you can see the full
2+
# license over at http://www.wtfpl.net/txt/copying/
3+
#
4+
# - Try to find Criterion
5+
#
6+
# Once done this will define
7+
# CRITERION_FOUND - System has Criterion
8+
# CRITERION_INCLUDE_DIRS - The Criterion include directories
9+
# CRITERION_LIBRARIES - The libraries needed to use Criterion
10+
11+
find_package(PkgConfig)
12+
13+
find_path(CRITERION_INCLUDE_DIR criterion/criterion.h
14+
PATH_SUFFIXES criterion)
15+
16+
find_library(CRITERION_LIBRARY NAMES criterion libcriterion)
17+
18+
set(CRITERION_LIBRARIES ${CRITERION_LIBRARY})
19+
set(CRITERION_INCLUDE_DIRS ${CRITERION_INCLUDE_DIR})
20+
21+
include(FindPackageHandleStandardArgs)
22+
# handle the QUIET and REQUIRED arguments and set CRITERION_FOUND to TRUE
23+
# if all listed variables are TRUE
24+
find_package_handle_standard_args(Criterion DEFAULT_MSG
25+
CRITERION_LIBRARY CRITERION_INCLUDE_DIR)
26+
27+
mark_as_advanced(CRITERION_INCLUDE_DIR CRITERION_LIBRARY)

doc/pictures/eonerc_logo.png

9.13 KB
Loading

doc/pictures/villas_fpga.png

13.9 KB
Loading

doc/pictures/villas_fpga.svg

+113
Loading

etc/fpga-simple.conf

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/** Example configuration file for VILLASfpga.
2+
*
3+
* The syntax of this file is similar to JSON.
4+
* A detailed description of the format can be found here:
5+
* http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files
6+
*
7+
* @author Steffen Vogel <[email protected]>
8+
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
9+
* @license GNU General Public License (version 3)
10+
*
11+
* VILLASfpga
12+
*
13+
* This program is free software: you can redistribute it and/or modify
14+
* it under the terms of the GNU General Public License as published by
15+
* the Free Software Foundation, either version 3 of the License, or
16+
* any later version.
17+
*
18+
* This program is distributed in the hope that it will be useful,
19+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+
* GNU General Public License for more details.
22+
*
23+
* You should have received a copy of the GNU General Public License
24+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
25+
*********************************************************************************/
26+
27+
# Some global settings are used by multiple configuration files
28+
# and therefore defined in separate files
29+
@include "global.conf"
30+
@include "plugins.conf"
31+
32+
fpgas = {
33+
vc707 = {
34+
/* Card identification */
35+
id = "10ee:7022";
36+
slot = "01:00.0";
37+
38+
intc = 0x5000;
39+
reset = 0x2000;
40+
do_reset = true;
41+
42+
ips = {
43+
switch_0 = {
44+
vlnv = "xilinx.com:ip:axis_interconnect:2.1"
45+
baseaddr = 0x0000;
46+
numports = 3;
47+
48+
paths = (
49+
{ in = "dma_0", out = "rtds_0" },
50+
{ in = "rtds_0", out = "dma_0" }
51+
)
52+
},
53+
rtds_0 = {
54+
vlnv = "acs.eonerc.rwth-aachen.de:user:rtds_axis:1.0"
55+
baseaddr = 0x3000;
56+
port = 0;
57+
},
58+
dma_0 = {
59+
vlnv = "xilinx.com:ip:axi_dma:7.1";
60+
baseaddr = 0x1000;
61+
port = 2;
62+
irq = 0
63+
}
64+
}
65+
}
66+
}
67+
68+
nodes = {
69+
rtds = {
70+
datamover = "dma_0";
71+
use_irqs = false;
72+
}
73+
}

0 commit comments

Comments
 (0)