1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Compare commits

...

1550 commits

Author SHA1 Message Date
Jitpanu Maneeratpongsuk
c60ef75070 fix: Broken error checking
Signed-off-by: Jitpanu Maneeratpongsuk <jitpanu.maneeratpongsuk@rwth-aachen.de>
2025-02-04 13:42:06 +01:00
Jitpanu Maneeratpongsuk
6d279280e8 fix: Comment format
Signed-off-by: Jitpanu Maneeratpongsuk <jitpanu.maneeratpongsuk@rwth-aachen.de>
2025-02-04 13:42:06 +01:00
Jitpanu Maneeratpongsuk
f28f802619 fix: Remove sleep from socket integration test
Signed-off-by: Jitpanu Maneeratpongsuk <jitpanu.maneeratpongsuk@rwth-aachen.de>
2025-02-04 13:42:06 +01:00
Jitpanu Maneeratpongsuk
7a2d689199 fix: Add error checking
fix: Naming and comment

fix: Remove socket_tcp_connection from header file
Signed-off-by: Jitpanu Maneeratpongsuk <jitpanu.maneeratpongsuk@rwth-aachen.de>
2025-02-04 13:42:06 +01:00
Jitpanu Maneeratpongsuk
d3cbf876cf fix: Uninitialize variable
Signed-off-by: Jitpanu Maneeratpongsuk <jitpanu.maneeratpongsuk@rwth-aachen.de>
2025-02-04 13:42:06 +01:00
Jitpanu Maneeratpongsuk
c07679bc32 feat: Extended integration test for socket TCP connection
Signed-off-by: Jitpanu Maneeratpongsuk <jitpanu.maneeratpongsuk@rwth-aachen.de>
2025-02-04 13:42:06 +01:00
Jitpanu Maneeratpongsuk
b23c12aab1 feat: Add TCP to the OpenAPI spec of socket node type
Signed-off-by: Jitpanu Maneeratpongsuk <jitpanu.maneeratpongsuk@rwth-aachen.de>
2025-02-04 13:42:06 +01:00
Jitpanu Maneeratpongsuk
7befa75390 fix: Add reconnect attempt after the connection is broken.
Move the establishment of tcp connection out of socket_start so that it will not block other node.

Signed-off-by: Jitpanu Maneeratpongsuk <jitpanu.maneeratpongsuk@rwth-aachen.de>
2025-02-04 13:42:06 +01:00
Jitpanu Maneeratpongsuk
5587fbde29 fix: Comment format and naming
Signed-off-by: Jitpanu Maneeratpongsuk <jitpanu.maneeratpongsuk@rwth-aachen.de>
2025-02-04 13:42:06 +01:00
Jitpanu Maneeratpongsuk
5df3fabcd1 feat: Add basic tcp connection to socket node type
Signed-off-by: Jitpanu Maneeratpongsuk <jitpanu.maneeratpongsuk@rwth-aachen.de>
2025-02-04 13:42:06 +01:00
Pascal Bauer
560af2961a Change accessibility of getMemoryBlocks() method of core to public.
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2025-01-30 14:21:07 +01:00
Niklas Eiling
9ba78f1fe3 fix: move task to villas namespace
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-29 14:18:09 +01:00
Pascal Bauer
297fbc511c fix formatting
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2025-01-28 17:49:54 +01:00
Pascal Bauer
22a5f54428 add from_directory method
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2025-01-28 17:49:54 +01:00
Niklas Eiling
ed6cd78b2f feat: make cast hook support writes
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-28 17:44:24 +01:00
Niklas Eiling
b433219af2 chore: update copyright in README
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-28 17:36:16 +01:00
Niklas Eiling
16b6a21512 fpga: make hwdef-parse.py correctly detect interrupt on zynq designs
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
9bf8f24695 fpga: update example jsons
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
d905d16b74 fpga: add dinoif_adc to hwdef-parse.py
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
780dffb9ab fpga: fix configCrossBar crashing if src or dest are nullptr
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
cee5f62c2d fpga: remove exceptions from AxisCache
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
5dd12eafc4 fpga: Apply suggestions from code review
Co-authored-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
0d6946bae9 fpga/ip/i2c: remove dead code and improve comment.
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
2d8b3fccd5 fpga: consolidate and update FPGA config examples
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
e9b1a4a528 fpga: improve comments
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
a7427d7cc0 fpga/ips: add invalidate method to AxisCache and whitelist the IP in hwdef-parse.py
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
ce0959d4ba fpga: Clean up dino.cpp
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
afcfe08576 fpga: Fix I2c causing an error when Dino FMC is not connected. We loose the self check, but this is not really possible if there is no Dino FMC.
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
3300e7b2cd fpga: Add axis_cache.cpp to CMakeLists.txt
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
bf2b18bf47 fpga: Add new Dino configuration register that allows triggering the DAC before the time step to dino.cpp
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
6b0b11e720 fpga: Add driver for new register interface of axis cache IP
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-24 10:32:57 +01:00
Niklas Eiling
0b49ca9afe fix: remove armhf image from push latest tag
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-16 13:42:20 +01:00
Niklas Eiling
278a64209a fix: latest:docker:latest not removing manifest in .gitlab-ci.yml
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2025-01-16 13:42:20 +01:00
Matthias Marcus Nowak
693cfee4d8 fixed formatting, suggestions by @stv0g
Signed-off-by: Matthias Marcus Nowak <marcus.nowak@rwth-aachen.de>
2024-12-09 11:33:43 +01:00
matthiasnowak
bf50f232f9 added uldaq config to enable external clock source
Signed-off-by: Matthias Marcus Nowak <marcus.nowak@rwth-aachen.de>
2024-12-09 11:33:43 +01:00
Niklas Eiling
6f82ce39b6 Fix missing copyright year in README.md
Co-authored-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-11-18 09:26:55 +01:00
Niklas Eiling
9c10d8836e readme: update copyright years
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-11-18 09:26:55 +01:00
Niklas Eiling
18791fe90f contributing: add reference to contributing guidelines in documentation
replaces current CONTRIBUTING.md with reference to documentation and adds a section in README.md referencing the same.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-11-18 09:26:55 +01:00
Niklas Eiling
26e6d69bfe fpga: add --timestep option to villas-fpga-ctrl
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-11-13 10:44:34 +01:00
e5ab276566 fix: Formatting
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-11-04 10:30:14 +01:00
bc3ee49911 fix(nix): Remove shellHook
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-11-03 11:08:23 +01:00
Steffen Vogel
124e59ecc7 feat(ci): Build Docker image via Nix
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-11-03 10:32:31 +01:00
Steffen Vogel
3ca49fa591 fix(ci): Nix bundle
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-11-03 10:32:31 +01:00
Steffen Vogel
87513caece fix(ci): Nix builds have no dependencies in the pipeline
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-11-03 10:32:31 +01:00
Steffen Vogel
0210c0bb2f feat: Test GitLab CI cache for /nix/store
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-11-03 10:32:31 +01:00
Steffen Vogel
50d86941b6 feat(ci): Build with Nix in CI
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-11-03 10:32:31 +01:00
Pascal Bauer
d521b5567f feat: add json parsing of iplist
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-10-31 15:21:30 +01:00
Pascal Bauer
c577e8a2a1 review: remove comment, change loglevel
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-10-31 15:21:30 +01:00
Pascal Bauer
5e23100df9 feat: add parsing for ip-ignorelist
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-10-31 15:21:30 +01:00
Pascal Bauer
ee83bb197b feat: ips can be ignored to be initialized in corefactory
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-10-31 15:21:30 +01:00
Steffen Vogel
b4c3ef8ac0 fix(opal): Restructure OPAL-RT clients
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-10-31 13:29:31 +01:00
Steffen Vogel
f6d5674e35 fix(opal): Update RT-LAB project configs
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-10-31 13:29:31 +01:00
Steffen Vogel
ff76b59185 fix(opal): Unresolved references
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-10-31 13:29:31 +01:00
Steffen Vogel
9bcb03d06c fix: Default clock for tasks to be monotonic
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-10-31 12:45:09 +01:00
Niklas Eiling
a96ba9b9d8 fix comments in memory, ethercat and rtp
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-10-31 12:45:09 +01:00
1bb217100e add functions for stack and heap prefaulting
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
Co-authored-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-10-31 12:45:09 +01:00
3e483de030 more checks against errors
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
Co-authored-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-10-31 12:45:09 +01:00
11069e782b use CLOCK_MONOTONIC
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
Co-authored-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-10-31 12:45:09 +01:00
Steffen Vogel
1520743f73 fix: Formatting with clang-format
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-10-31 12:18:20 +01:00
Pascal Bauer
914ea0bac6 Refactor FPGA device and drivers
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-10-31 12:18:20 +01:00
Steffen Vogel
706bc635ef deps: Install libnice
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-10-31 12:14:19 +01:00
Steffen Vogel
01568aef51 fix(ci): Add missing dependency in deploy:docker stage
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-10-31 11:58:52 +01:00
Alexandra
9b780e2809 include arm64 and small letters pi5
Signed-off-by: Alexandra <alexandra.bach@eonerc.rwth-aachen.de>
2024-10-31 11:58:52 +01:00
Calvin Katt
1923e01a2a Updated deploy:docker CI job to fix broken dependency on changed packaging job
Signed-off-by: Calvin Katt <katt.calvin@gmail.com>
2024-10-31 11:58:52 +01:00
Calvin Katt
25651c4491 Updated CI packaging stage to use a different runner tag per job to allow choosing of different runners for different architectures (e.g. RPi5 for arm64)
Signed-off-by: Calvin Katt <katt.calvin@gmail.com>
2024-10-31 11:58:52 +01:00
60b397dc29 Remove broken opal node-type
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-10-31 11:07:52 +01:00
9a9c890c09 lab18: Apply suggestions from code review
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-10-25 12:30:04 +02:00
Alexandra
b42f6d747b Add license and correct typo
Signed-off-by: Alexandra <alexandra.bach@eonerc.rwth-aachen.de>
2024-10-25 12:30:04 +02:00
Alexandra
6c1f303332 added config files according to docu
Signed-off-by: Alexandra <alexandra.bach@eonerc.rwth-aachen.de>
2024-10-25 12:30:04 +02:00
Philipp Jungkamp
802f86090b node-ethercat: Fix #include after opened namespace
The `ethercat_config.hpp` header was included from `ethercat.hpp`
after opening the `villas::node` namespace. This made all definitions
originating from that header including the transitive definitions
from ethercat's `ecrt.h` part of the `villas::node` namespace.

The especially problematic part was that `ecrt.h` itself has an
`#include <netinet/in.h>` introduced in [1]. This caused the libc
definitions for `sa_familt_t`, `sockaddr_in` and `sockaddr_in6` to be
moved into the `villas::node` namespace, causing build error on recent
`ethercat` versions.

[1]: c2f9baf96a

Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2024-10-16 21:59:41 +02:00
Steffen Vogel
28d354cb84 Fix formatting with clang-format
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-10-15 19:31:49 +02:00
Pascal Bauer
23af32d25e add get method getNumberIrqs()
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-09-25 15:15:24 +02:00
Pascal Bauer
83e95f88a5 Refactor: change namespace pci to devices
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-08-30 12:23:02 +02:00
Pascal Bauer
c41f91f1ca refactor: rename DeviceList to PciDeviceList
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-08-30 12:23:02 +02:00
Pascal Bauer
7ec6b44550 update codeowner
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-08-30 12:23:02 +02:00
Pascal Bauer
975c02dc7d Refactor: rename pci class to pci_device
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-08-30 12:23:02 +02:00
Pascal Bauer
91b541943e Refactor: Move pci to devices/pci_device
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-08-30 12:23:02 +02:00
Philipp Jungkamp
40440f2466 ethercat: Shuffle includes to fix failing Nix builds
Signed-off-by: Philipp Jungkamp <p.jungkamp@gmx.net>
2024-08-28 23:20:52 +02:00
Niklas Eiling
6697e2eb72 Protobuf: Remove include dependency on generated header
This allows easier reuse of ProtobufFormat.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-08-27 06:44:47 +02:00
Niklas Eiling
18cdd2a636 protobuf: Clean up CMakeLists
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-08-26 10:09:01 +02:00
Niklas Eiling
7e1bad3590 fpga: Use float accessor for reading and writing floats
This fixes breaking strict aliasing rules.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-08-26 10:09:01 +02:00
Niklas Eiling
48189b1aaa protobuf: Install villas.pb-c.h to include/villas/formats
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-08-26 10:09:01 +02:00
Niklas Eiling
36687d6af4 fpga: fix debug output
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-08-26 10:09:01 +02:00
Niklas Eiling
8df05c3c71 lib/formats: install protobuf header
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-08-26 10:09:01 +02:00
Niklas Eiling
b52f445a52 fpga: handle receving more data than size of configured signals
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-08-26 10:09:01 +02:00
Niklas Eiling
97fccd604d PCIeCard: load correct kernel module
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-08-26 10:09:01 +02:00
Niklas Eiling
eeeb9b1d7b dino: fix wrong copyright notice in dino.cpp
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-08-26 10:09:01 +02:00
Niklas Eiling
9b79c16fb3 fpga: make FPGA support sending and receiving integers
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-08-26 10:09:01 +02:00
0582a27ee0 fix: Remove dead code from iec61850 SV node-type
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-08-21 12:41:07 +02:00
90ce4a0fe7 fix(iec61850-9-2): Fix Sampled Values node-type for NEIS paper
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-08-13 13:26:08 +02:00
6bd42af4e0 nix: Update Flake inputs
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-08-13 13:12:47 +02:00
IgnoreWarnings
4d062d7098 minimize container requirements
Signed-off-by: IgnoreWarnings <pascal.bauer@rwth-aachen.de>
2024-08-09 09:14:47 +02:00
IgnoreWarnings
2bc2eaed28 ensure loading of vfio modules
Signed-off-by: IgnoreWarnings <pascal.bauer@rwth-aachen.de>
2024-08-09 09:14:47 +02:00
Niklas Eiling
f25e1dd689 log: fix undefined intitialization order of static objects. fixes #799.
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-08-05 14:57:13 +02:00
Pascal Bauer
2d9bb26847 make "getOrAttachGroup" public
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-08-05 10:15:06 +02:00
Pascal Bauer
74155d9685 add optional indicator
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-07-31 11:54:16 +02:00
Pascal Bauer
9e89ba32c2 make baseaddress optional, remove debug output
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-07-31 11:54:16 +02:00
Pascal Bauer
e6524f944f ignore type errors
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-07-29 16:14:26 +02:00
Pascal Bauer
81cb364d1f add module "dinoif_fast_nologic"
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-07-29 16:14:26 +02:00
Niklas Eiling
5f44e16ced fpga: remove dead code and improve comments in Dino IP
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-07-29 13:50:36 +02:00
Niklas Eiling
739f8fd0a8 sample: fix sample_data_remove moving too much memory
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-07-29 13:50:36 +02:00
Niklas Eiling
365bdd6288 dp hook: fix converted signals being inserted at the wrong position
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-07-29 13:50:36 +02:00
Niklas Eiling
7128da24c3 fpga: make dma able to handle sequence numbers generated in the FPGA
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-07-29 13:50:36 +02:00
Niklas Eiling
64058be78f dp hook: make it an error when window size is 0
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-07-29 13:50:36 +02:00
Niklas Eiling
136d033cd3 fpga: fix dino setting wrong offset value to float converter
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-07-29 13:50:36 +02:00
Niklas Eiling
d2c1f55f21 fpga: fix timestep being hardcoded
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-07-29 13:50:36 +02:00
Niklas Eiling
675c489126 fpga: switch to float accessor for writes
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-07-29 13:50:36 +02:00
Niklas Eiling
7991d31393 fpga/dino: add and set new registers
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-07-29 13:50:36 +02:00
Pascal Bauer
f364db1748 add parsing for baseaddress
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-07-29 11:29:03 +02:00
Pascal Bauer
81f8981783 add member and getter for baseaddress
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-07-29 11:29:03 +02:00
Pascal Bauer
54796d11b2 removed void indicator
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-06-27 09:54:58 +02:00
Pascal Bauer
80fa0429dd change name of "parseVLNV" to "parseIpIdentifier"
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-06-27 09:54:58 +02:00
Pascal Bauer
ba92d5447f add linebrakes
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-06-27 09:54:58 +02:00
Pascal Bauer
f79f7f4ca7 refactor make
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-06-27 09:54:58 +02:00
Pascal Bauer
7d37c56947 move ip initialization into function
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-06-27 09:54:58 +02:00
Pascal Bauer
05f7a03909 move configure ips into function
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-06-27 09:54:58 +02:00
Pascal Bauer
cb53713953 move reordering of ips into function
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-06-27 09:54:58 +02:00
Pascal Bauer
823ba3281e move VLNV parsing to function
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-06-27 09:54:58 +02:00
Niklas Eiling
411b0ad49e cmake: fix common not being installed
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-06-07 07:04:31 -07:00
Niklas Eiling
5325a85d99 ci: add needs statements and use DOCKER_TAG
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-06-07 15:40:54 +02:00
Niklas Eiling
bda163e99b node: remove brackets on ternary operator
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-06-06 09:29:29 +02:00
Niklas Eiling
361f20f661 dp: use fmt::format instead of strf
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-06-06 09:29:29 +02:00
Niklas Eiling
f84e0691f1 fpga: fix redundant return in getPollFD
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-06-06 09:29:29 +02:00
Niklas Eiling
480beeefbd hook: initialize signals with an empty list
This created issues when using hooks without a SuperNode. Some code assumes signals != nullptr.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-06-06 09:29:29 +02:00
Niklas Eiling
d992d2a923 node: avoid segfaults when signals are nullptr
This can be an issue if we use a node without SuperNode.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-06-06 09:29:29 +02:00
Niklas Eiling
c1425046ae dp hook: use .c_str to convert from std::string
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-06-06 09:29:29 +02:00
Niklas Eiling
7ef44a4911 fpga: do not return poll FDs if we are not using FDs
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-06-06 09:29:29 +02:00
Niklas Eiling
584712300d fpga: fix wrong unpack string for config parsing
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-06-06 09:29:29 +02:00
Niklas Eiling
aeda901e47 fpga: use separate locks for write and read to allow them to be used concurrently
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-06-05 12:30:24 +02:00
Niklas Eiling
50bc9d9510 fpga: use snake case for low_latency_mode
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-05-29 09:18:00 +02:00
Niklas Eiling
296b7d873a fpga: improve comments and removed dead code
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-05-29 09:18:00 +02:00
Niklas Eiling
973834b3aa fpga: use constants to access registers
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-05-29 09:18:00 +02:00
Niklas Eiling
1e58d7a452 fpga: remove commas from conf
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-05-29 09:18:00 +02:00
Niklas Eiling
b74ebd391f fpga: remove output from performance critical code
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-05-29 09:18:00 +02:00
Niklas Eiling
0c3a9f4729 fpga: convert SignalType to string before printing
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-05-29 09:18:00 +02:00
Niklas Eiling
1b06828711 DP hook: fix if that is never reached and check config in check()
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-05-29 09:18:00 +02:00
Niklas Eiling
34bca6826b fpga: make dino sampling rate configurable at top level and via json
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-05-29 09:18:00 +02:00
Niklas Eiling
12af65b2b4 fpga: move register config for dino to DinoAdc
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-05-29 09:18:00 +02:00
Niklas Eiling
4911c96d8d fpga: update libxil subreport so we support 64-bit addressing
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-05-29 09:18:00 +02:00
Niklas Eiling
21221eb698 fpga: fix empty search path being an error
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-05-29 09:18:00 +02:00
61ab82dbb7 Fix missing idle_stop setting in integration tests
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
61e74b3e73 Revert default sample length to 64
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
10eb88e7c8 test_rtt: Disable integration test in CI
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
cc44595f98 test_rtt: Fix possible use of uninitialized variable
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
63337efdd7 test_rtt: Add missing cooldown phase in runtime estimation
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
722280f968 Increase default sample length
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
c10fcc5bd4 test_rtt: Fix logging
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
aee96e846f webrtc: Improve logging
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
b0680bb5cf test_rtt: Fix compiler errors
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
54d7cf0620 webrtc: Show connection details
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
2e00453f7b test_rtt: Improve handling of defaults
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
c4afbf5453 test_rtt: Print estimated test durations
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
f6c7434a61 test_rtt: Rework calculation of test duration
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
64749223e8 test_rtt: Improve statistics
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
139101c447 webrtc: Enable ICE TCP
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
047fca5561 test_rtt: Another round of new features
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
d8520699b1 format: Allow printing test meta data to result file
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
8978374d92 csv, tsv: Fix printing of optional fields
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
bc14304f5e test_rtt: Fix wrong option identifier
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
a366b80109 Fix formatting
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
09bbd506cd format-all: Exclude third-party or generated code
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
cad2da3a59 iec61850_sv: Fix IEC 61850-9-2 Sampled Values node and unit test
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
4b896a8d7c super_node: Fix configuration of idle_stop setting
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
84f0ea9cb5 test_rtt: Fix test case numbering
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
bc95217766 test_rtt: Stop test cases properly in order to close file handles
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
1748f433fe webrtc: Fix libdatachannel version detection
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-05-28 19:45:55 -07:00
Steffen Vogel
e26a5c1b48 hypersim: Update UCM code for multiple signal values
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-05-02 10:30:12 +02:00
Niklas Eiling
ed05671a51 fpga: improve comments in register.cpp
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-04-19 10:09:47 +02:00
Niklas Eiling
c151be5cca fpga: fix includes and various comments
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-04-19 10:09:47 +02:00
Niklas Eiling
f1776f8be4 fpga: improve comments for fastRead and fastWrite
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-04-19 10:09:47 +02:00
Niklas Eiling
a2ff0aca43 fix formatting in fpga
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-04-19 10:09:47 +02:00
Niklas Eiling
9cf926d84e fpga: add lowLatencyMode setting
This setting improves latency by remove various checks.
Use with caution! Requires read cache in FPGA design!
The common use case in VILLASfpga is that we have exactly
one write for every read and the number of exchanged signals
do not change. If this is the case, we can reuse the buffer
descriptors during reads and write, thus avoidng freeing,
reallocating and setting them up.
We set up the descriptors in start, and in write or read,
we only reset the complete bit in the buffer descriptor and
write to the tdesc register to start the DMA transfer.
Improves read/write latency by approx. 40%.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-04-19 10:09:47 +02:00
Niklas Eiling
f498518236 fpga: update ips json in fpga.conf
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-04-19 10:09:47 +02:00
Niklas Eiling
2cc8cad115 fpga: expose methods for finer control over DMA data path
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-04-19 10:09:47 +02:00
Niklas Eiling
248a4b3a0d fpga: improve dma latency
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-04-19 10:09:47 +02:00
Niklas Eiling
483293aec8 fpga: turn off all interrupts when using polling
this improves the latency by at least 4 us in my setup.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-04-19 10:09:47 +02:00
Niklas Eiling
57d7396c09 fpga: optimize sg descriptor rings
we are now using only one memory block for both sg rings. This is
required so that the SG interface can benefit from a read cache

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-04-19 10:09:47 +02:00
Niklas Eiling
9d1c45440c Update .gitlab-ci.yml
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-04-15 07:52:03 +02:00
2529c7b2d7 Remove superfluous includes
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 18:56:28 +02:00
1204b47d29 test_rtt: Fix integration test
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 14:31:58 +02:00
718f6ca7eb test_rtt: Fix cppcheck warnings
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 14:31:58 +02:00
7fb7294ff0 Fix signal and format handling
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 14:31:58 +02:00
7f8f7023b4 test_rtt: Port to C++
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 14:31:58 +02:00
aad7fb478e Fix code formatting in commented code section
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 14:31:58 +02:00
0d231c28b8 Remove obsolete villas-test-rtt CLI application
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 14:31:58 +02:00
0b04f4fd39 test_rtt: Show test process
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 14:31:58 +02:00
c1f8d0fa80 stats: Indent histogram output
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 14:31:58 +02:00
3023ddaa3a Fix some typos and harmonize log output
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 14:31:58 +02:00
abed592b9d Harmonize formatting and style of example configuration files
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 09:38:57 +02:00
a2d55a9b6e Harmonize descriptions of plugins
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 09:06:15 +02:00
93cbc5d518 webrtc: Fix several TODOs and other smaller tweaks
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 09:02:55 +02:00
8a3be3d8ba nix: Reformat with nixfmt
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 08:50:04 +02:00
145b6cb0bd nix: Use nixfmt for formatting
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 08:50:04 +02:00
774f6f5351 nix: Fix types and capitalization of comments
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 08:50:04 +02:00
d5747e21df nix: Remove minimal development shell
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 08:50:04 +02:00
06aabbd267 nix: Rename packages in flake output
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 08:50:04 +02:00
e6bb737036 nix: Remove non-standard crossPkgs Flake output
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 08:50:04 +02:00
9da93eafed nix: Replace our ethercat package which the one packaged in nixpkgs
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-10 08:50:04 +02:00
3f10581973 python: Rename package and bump version
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-09 10:51:17 +02:00
115316fedb python: Require linuxfd dependency only on Linux platforms
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-04-09 10:51:17 +02:00
Niklas Eiling
bcb83e2733 Update CODEOWNERS
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-03-28 12:42:27 +01:00
aea884e4c4 Fix REUSE warnings
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-27 17:22:07 +01:00
e032c9857c thirdparty: Update CLI11
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-27 17:22:07 +01:00
936830d484 Remove unused includes and variables
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-27 17:22:07 +01:00
8db66e25c1 rtp: Fix headers
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-27 17:22:07 +01:00
f64c9af259 compat: Fix comptability check in webrtc node-type
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-27 17:22:07 +01:00
553f01d131 compat: Update reliability PAI for libdatachannel >= 0.20
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-27 17:22:07 +01:00
e7104cd039 compat: "requires" is a C++20 reserved keyword
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-27 17:22:07 +01:00
b66b125ea1 protobuf: Fix tests
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 23:59:51 +01:00
5c66522bcb protobuf: Add missing Python depdendency to project.toml
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 23:59:51 +01:00
a6993cb54f reuse: Fix missing license header
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 23:59:51 +01:00
62e2a6ce3c python: Reformat code
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 23:59:51 +01:00
dc7e51c293 protobuf: Fix output path for protoc
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 23:59:51 +01:00
14ad4ad351 protobuf: Add generated Python code to repo
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 23:59:51 +01:00
79484bc67c python: Add protobuf format and test
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 23:59:51 +01:00
b5bbb8e496 nix: Fix villas-python package and include Protobuf generated code
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 23:59:51 +01:00
04bca3ae8b cmake: Fix check for rtp node-type
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 13:01:15 +01:00
31aabb9acf common: Add missing include
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 13:01:15 +01:00
a792a4abd6 nix: Update to unstable use new nixpkgs-version of libiec61850, lib60870 and libdatachannel
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 13:01:15 +01:00
6bc11d1b79 libre: Use CMake in deps.sh
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 13:01:15 +01:00
d8acf7b26b hook: Fix compiler warning about overloaded virtual function
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 13:01:15 +01:00
5e70fc38fd rtp: Upgrade libre dependency to v3.6.0
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 13:01:15 +01:00
132b7b077f nix: Upgrade to Nixpkgs 23.11
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 13:01:15 +01:00
d9b283636f nix: Remove obsolete option argument
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 13:01:15 +01:00
d6cdca46e4 nix: Add option to configure config file location for villas-node
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 13:01:15 +01:00
01da8ac47f protobuf: Add support for new frame flag
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-26 11:53:20 +01:00
Niklas Eiling
8f1c35d4f8 gitignore: add compile_commands.json to gitignore
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-03-14 16:07:45 +01:00
Niklas Eiling
a000e15308 fpga: make Dino and Aurora IPs optional in utils
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-03-14 16:07:45 +01:00
Niklas Eiling
c644c8f630 fpga: DMA: poll BD instead of hardware register
polling HW is slow (>1us). Polling RAM is faster. This is a first implementation which only polls the first BD that is active. This is why this commit also removes the second read in nodes/fpga. This is not really useful anyways.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-03-14 16:07:45 +01:00
Niklas Eiling
ca03e1d406 fpga: enable using Xilinx xdma IP as DMA to AXI bridge as required for Ultrascale+ FPGAs
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-03-14 16:07:45 +01:00
Niklas Eiling
d99d0918ad fpga: add configurations for alveo FPGA
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-03-14 16:07:45 +01:00
Niklas Eiling
322cdf9639 fpga: do not create the vfio container twice
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-03-14 16:07:45 +01:00
Niklas Eiling
7f1fe8f742 fpga: default Dino rate should be 20kHz
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-03-14 16:07:45 +01:00
Niklas Eiling
ce59e3183d fpga: fpga::createCards not finding a config is not an error
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-03-14 16:07:45 +01:00
Steffen Vogel
f9ed272456 node: Fix null-pointer dereference for internal loopback nodes
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-03-12 23:20:09 +01:00
d4ce4a7fe6 ci: Delete Docker manifest before creating one
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-03-12 15:29:47 +01:00
Steffen Vogel
576df42e42 mqtt: Do not attempt validating topics if they are not set
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-03-12 13:20:32 +01:00
Steffen Vogel
a199cf79fc ci: Disable build of arm64 and armv7 Docker images
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-03-12 12:09:51 +01:00
Steffen Vogel
f289fe7879 ci: Another attempt at fixing the tests
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-03-12 12:09:51 +01:00
Steffen Vogel
8a7a413359 ci: Use full image name for qus
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-03-12 12:09:51 +01:00
Steffen Vogel
327f11312a ci: Fix tests in unprivileged environment
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-03-12 12:09:51 +01:00
Steffen Vogel
33af3c57a4 ci: Add QEmu User Static emulation
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-03-12 12:09:51 +01:00
Steffen Vogel
a83dd6e495 ci: Attempt fixing cross-platform builds
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-03-12 12:09:51 +01:00
Steffen Vogel
b3259355b5 ci: Push/Pull images and remove docker tag
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-03-12 12:09:51 +01:00
73ff061ca8 Fix syntax error
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00
449e132f27 Remove trailing whitespace
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00
535d64a644 Replace last tab indentation with spaces
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00
1560f67656 Reformat Python code with black
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00
bc24676138 Use spaces for indention of shell scripts
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00
b58c2f33ec Use spaces for indention of Javacript files
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00
dc436073a2 Use spaces for indention of C++ comments
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00
4b36073711 Use spaces for indention of CMake files
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00
1678ec915f Use spaces for indention of .json files
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00
1b1643834c Use spaces for indention of .conf files
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 23:18:47 +01:00
bc670254e2 file: Make directories listable when created
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 22:34:35 +01:00
Steffen Vogel
b1ccd6a8f6
Merge pull request #734 from VILLASframework/integrate-fpga-submodule
Integrate VILLASfpga submodule
2024-02-29 21:26:36 +01:00
915a6d860b Fix cppcheck performance warning
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 20:35:00 +01:00
5244d9aec0 Fix cppcheck invocation
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 20:04:53 +01:00
4db21c6ec2 Fix shebangs of bash scripts to work under NixOS
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 20:04:36 +01:00
d2da4e5849 Remove unused license
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 20:04:32 +01:00
38f649a11d nix: Remove fpga and common inputs
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 19:42:13 +01:00
5f42f09a87 cmake: Only enable FPGA support if libxil submodule is present
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 19:36:27 +01:00
3d73c759ea Reformat all code with clang-format
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 19:34:27 +01:00
29cf5540a0 Fix some compiler warnings in fpga code
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 19:33:40 +01:00
a2abaa3cda Merge project files, scripts and CMake files of VILLASfpga
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 19:33:23 +01:00
02a6f1d466 Readd VILLASfpga
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 19:04:37 +01:00
10fafeb155 Remove VILLASfpga submodule
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 19:01:51 +01:00
1cd3c9c726 Fix CMakeLists
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
0c75b25662 Workaround for GCC bug
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
624b4fe2f7 cmake: Remove obsolete TOPLEVEL_PROJECT variable from former common sub-module
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
90df8760c8 Consollidate misc files from former common sub-module
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
4b6b240578 ci: fix unspecified runner
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
d1772096fe fix ci not knowing CI_BUILD_REF_SLUG
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
5f8272abfa kernel/vfio_device: add logging output when pciMsiDeInit is called
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
04ba5eb2cf kernel/pci: fix memory leak in Id()
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
5d3f170c40 add printGraph method to MemoryManager
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
4e6f5233da make DeviceList a singleton and expose the eventFd in Device
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
07cc1c96d8 add Niklas to copyright notices in vfio code
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
3a08e57516 fix exception strings getting lost because of rethrowing them
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
7fde2c0535 add CODEOWNERS
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
ad2619cba5 fix readHostBar throwing errors when BAR is correct
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Philipp Jungkamp
66569cf9c4 Fix fmt 10.0.0 related formatting errors.
Signed-off-by: Philipp Jungkamp <p.jungkamp@gmx.net>
2024-02-29 18:58:07 +01:00
IgnoreWarnings
799183b0fb Load vfio modules at runtime.
Defines are replaced by constructor parameters. The default parameter makes the function backwards compatible.

Signed-off-by: IgnoreWarnings <pascal.bauer@rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Steffen Vogel
b195058d03 Fix cppcheck warnings
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
b359c2715d Fix formatting for VFIO changes
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
a5ab5ebc65 Fix VFIO logger names
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
14a6a0fcdb Add missing REUSE headers
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
4349aaaac9 Fix broken includes due to auto format
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
e34b1ffacd Add .git-blame-ignore-revs
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
7d10544d79 Apply clang-format changes
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
2cdced9347 Make editorconfig configuration compatible with clang-format
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
c938f4f242 Add clang-format config
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
IgnoreWarnings
d73663bb01 Kernel module loading system and bug fixes of vfio (#110)
- feature: Header to specify which kernel modules (vfio support) to load
- Bug fixes: wrong errror messages, bugged region cap
- Quality of use improvements e.g. getter and str()

---------

Signed-off-by: IgnoreWarnings <pascal.bauer@rwth-aachen.de>
Signed-off-by: IgnoreWarnings <119685519+IgnoreWarnings@users.noreply.github.com>
Co-authored-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
5bfade1d66 Added missing mail addresses to SPDX copyright headers
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
525e56dcd5 Relicense FindCriterion.cmake to Apache 2.0
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
02f06b607f Harmonize file descriptions and mail addresses
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
6c582cbf91 Make project REUSE compliant
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
fc89e0f0a9 Harmonize comment and code-style
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
70398e02b7 Fix function declaration for uuid::toString()
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
ac67044222 Improve UUID handling
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Philipp Jungkamp
2103e4b05f add overloaded helper util for std::visit
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
97b2e916c1 fix code-style
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
d4bcfd59f2 log: fix configuration of log formatter and level
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
dfc24cf534 use C++ instead of C comment style
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
2cc7c46d3a add CMake option to disable colored log output
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
cde7bd6dd6 log: remove old OPAL logger sink
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
822035df82 log: allow adding additional sinks
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
fe1385e2c6 pci: pass string var as const reference
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
fe95c246a3 pcie: use scanff instead of istringstream
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
ba63fc9ad7 pci: use PCI_BASE_ADDRESS_N macro
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
cf855a9f46 pci: rename bar to barNum and re-add bar size to log
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
248223259e use C++ STL for handling file IO
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
1844d4fbfc code-style fixes
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
Steffen Vogel
e9e638d6a4 cmake: fix homepage url
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
80c0235b78 cmake: add missing version number
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Steffen Vogel
7289cb97b7 cmake: fix CI if not run in a Git repo
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Manuel Pitz
66d7643114 make compatible to fmt version 9.0.3
Signed-off-by: Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
18763c4f80 initialize variables in constructors
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
c9e3c7919d graph: remove map key test with map size
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Steffen Vogel
009ad2225e vfio: fix compatability with older kernels (4.19) found on OPAL RT-Linux targets
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00
Niklas Eiling
4c60d2a2bc Revert "villas/memory: make MemoryBlock use shared_ptr instead of unique_ptr"
Instead, we want to rework the Memory handling entirely.

This reverts commit c8128db732b0b01a418f26a0a54a2464fe1d09e6.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
f69a2a3db0 remove hardcoded pcie device id in pci.cpp
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
2fa210f954 villas/memory: make MemoryBlock use shared_ptr instead of unique_ptr
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
6fac4e583b vfio: rewrite BAR if it has the correct value
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
310136c7cf update Steffens mail address
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
Pascal Bauer
3217259c7f initialized member id with 0
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2024-02-29 18:58:07 +01:00
2e506a5bef ci: fix build badge
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
c35bab4490 vfio: increase logging verbosity
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
e68b9d4e64 vfio: convert container from singleton to normal class
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
e743b42c6f code cleanups
- Use C++ style comments
- Harmonize indentions
- Harmonize comment capitalization

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
958cc83fae fix broken EONERC logo
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
db23a3429f general code-style fixes
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
3e0c6b772a use C++ style comments
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
dfd3a3be8d vfio: fix hot reset using the wron fd
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
c89897aeaf use only absolute include paths
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
498cc6d681 remove lib/kernel/vfio.cpp as it is not needed anymore
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
8cfa72136a improve vfio cleanup; fix potential segfault in graph/directed.hpp
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
20719d7d6c vfio: fix group not being set as attached
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
5b5ac8114b refactor vfio code. split into 3 files and remove friedship between classes
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
da6fdab06c kernel/vfio: improve cleanup
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-29 18:58:07 +01:00
6bd33b7e95 fix copyright notice
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
65a971d68e check CI pipeline fail
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
6b0818e0ed update README
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
Niklas Eiling
0ce0c517c0 kernel: fix unsafe use of readlink 2024-02-29 18:58:07 +01:00
9f1ddc2c74 memory: add missing typedef 2024-02-29 18:58:07 +01:00
8f178aacdb code style fixes 2024-02-29 18:58:07 +01:00
edf5d45ee2 update to Fedora to version 35 2024-02-29 18:58:07 +01:00
bf8a5a160c minor fixes for VILLASfpga 2024-02-29 18:58:07 +01:00
Manuel Pitz
c3755a8e3f dsp: update to deque and add rectangular window 2024-02-29 18:58:07 +01:00
Manuel Pitz
c9898b1680 dsp-window: remove correction factor from template 2024-02-29 18:58:07 +01:00
8ee59f0547 relicense under Apache 2.0 2024-02-29 18:58:07 +01:00
252b08c445 remove empty file 2024-02-29 18:58:07 +01:00
Manuel Pitz
78d30565f8 window_cosine update to c++17 2024-02-29 18:58:07 +01:00
Manuel Pitz
477be33688 revert to c++17 2024-02-29 18:58:07 +01:00
Manuel Pitz
1ad79dfc80 window: add support for cosine moving windows 2024-02-29 18:58:07 +01:00
Manuel Pitz
d72186050a switch from cpp 17 to cpp 20 2024-02-29 18:58:07 +01:00
Manuel Pitz
6c9cb0966a dsp: add window.cpp 2024-02-29 18:58:07 +01:00
0f2c1d3030 fix cppcheck warnings 2024-02-29 18:58:07 +01:00
1398c17697 hist: fix initialization of histograms 2024-02-29 18:58:07 +01:00
6d531b4397 updated mail address 2024-02-29 18:58:07 +01:00
5c036a02dd update copyright year 2024-02-29 18:58:07 +01:00
cfc3320666 remove support for Darwin/macOS 2024-02-29 18:58:07 +01:00
ab1d3a95eb log: improve compatability 2024-02-29 18:58:07 +01:00
cd9e33a6e9 plugin: rewrite to add support for sub registries 2024-02-29 18:58:07 +01:00
43be792f03 signals: add more default signals 2024-02-29 18:58:07 +01:00
77cdc67bf1 fix popen unit test 2024-02-29 18:58:07 +01:00
8cc66d905b utils: fix isPrivileged 2024-02-29 18:58:07 +01:00
5c6c089ef5 popen: split up C++ stream part 2024-02-29 18:58:07 +01:00
2a3b464a84 fix coding style in Plugin class 2024-02-29 18:58:07 +01:00
Jonas Schroeder
1c1c88a417 dont respond to terminal resize when output is redirected
Signed-off-by: Jonas Schroeder <jonas.schroeder1@rwth-aachen.de>
2024-02-29 18:58:07 +01:00
9f945a3ad3 port large parts to C++ 2024-02-29 18:58:07 +01:00
Sonja Happ
fbcf7d67f9 upgrade minimum required versions for spdlog (1.3.1 to 1.6.0) and fmtlib (5.2.0 to 5.3.0) 2024-02-29 18:58:07 +01:00
13656e909a state: port to C++ 2024-02-29 18:58:07 +01:00
9fd0ef9a61 exceptions: show config error 2024-02-29 18:58:07 +01:00
3ddd7a0200 log: fix prefix 2024-02-29 18:58:07 +01:00
5bb68b2fe1 add utils::isPrivileged() 2024-02-29 18:58:07 +01:00
5c0a96c911 cppcheck fixes 2024-02-29 18:58:07 +01:00
0d40348193 use C++ code-style 2024-02-29 18:58:07 +01:00
6ca354bcfd remove dependency on std::filesystem 2024-02-29 18:58:07 +01:00
6d0cea1244 vfio: make compatible with 32bit compilation 2024-02-29 18:58:07 +01:00
a028429119 tsc: use compiler intrinsics 2024-02-29 18:58:07 +01:00
6f39cbc8a6 log: improve readability of log outputs 2024-02-29 18:58:07 +01:00
86d612cf9c add gitignore 2024-02-29 18:58:07 +01:00
07bc3537a9 fix doxygen @todo command 2024-02-29 18:58:07 +01:00
92ff8e1edd log: fix unsupported flag on musl-libc / alpine 2024-02-29 18:58:07 +01:00
890282bd32 log: add support for glob style logger expressions 2024-02-29 18:58:07 +01:00
6754329aef plugin: add support for spdlog custom formatter 2024-02-29 18:58:07 +01:00
155a580314 update copyright year 2024-02-29 18:58:07 +01:00
62de5f849d improve naming of plugin loggers 2024-02-29 18:58:07 +01:00
f64fb79f05 remove unused list functions 2024-02-29 18:58:07 +01:00
3bd2dade2d kernel: refactor naming style 2024-02-29 18:58:07 +01:00
b9e9012a09 kernel: remove dead code 2024-02-29 18:58:07 +01:00
b4ecf659b4 utils: add some helpers to generate UUIDs 2024-02-29 18:58:07 +01:00
7e3e16d803 fix cppcheck warning 2024-02-29 18:58:07 +01:00
827104b9d7 ci: bump version of Fedora 2024-02-29 18:58:07 +01:00
d6c60b7302 kernel: check if process is running in a containerized environment 2024-02-29 18:58:07 +01:00
d04d616eea drop legacy logger 2024-02-29 18:58:07 +01:00
2c90c6c7e7 advio: fix WebDav test URL 2024-02-29 18:58:07 +01:00
da606fb7db exception: fix missing error message 2024-02-29 18:58:07 +01:00
e78be9ca8d musl compatability fixes 2024-02-29 18:58:07 +01:00
ac9551c8d4 fix compiler warning about uninitialized struct fields 2024-02-29 18:58:07 +01:00
Manuel Pitz
d2b85fc66c list: add vlist_clear() 2024-02-29 18:58:07 +01:00
55aa580145 log: fix adjustment of log level and format for sinks 2024-02-29 18:58:07 +01:00
8968f74377 fix HTTP user agent constant 2024-02-29 18:58:07 +01:00
98bf2eca1e buffer: merge two buffer implementations 2024-02-29 18:58:07 +01:00
0f11f80194 uuid: use other uuids as namespace 2024-02-29 18:58:07 +01:00
e63dd10f3f utils: add some helpers to generate UUIDs 2024-02-29 18:58:07 +01:00
fb61dc31ef another round of fixes for the cpuset code 2024-02-29 18:58:07 +01:00
d78b327d34 minor fixes for affinity code 2024-02-29 18:58:07 +01:00
43e79dd547 rt: add kernel::rt::setThreadPriority() 2024-02-29 18:58:07 +01:00
20556139aa fix a lot of cppcheck warnings and errors 2024-02-29 18:58:07 +01:00
acc5817737 ci: enable cppcheck 2024-02-29 18:58:07 +01:00
d2c7638060 fix cppcheck warnings 2024-02-29 18:58:07 +01:00
c3af9f5e48 fix unit tests 2024-02-29 18:58:07 +01:00
7c616a3c1c add vlist_init_and_push() 2024-02-29 18:58:07 +01:00
52ab5b0c84 warn about unused return values 2024-02-29 18:58:07 +01:00
626fc549c9 add uuid as new dependency 2024-02-29 18:58:07 +01:00
3fb3a00fcb list: rework lookup methods to use C++ templates 2024-02-29 18:58:07 +01:00
46d8815014 exceptions: show location of configuration error 2024-02-29 18:58:07 +01:00
91a7e2632d utils: fix implementation of SWAP() for complex objects 2024-02-29 18:58:07 +01:00
1316fe0913 buffer: keep original behaviour 2024-02-29 18:58:07 +01:00
39954c241e fix code-style 2024-02-29 18:58:07 +01:00
53b7de675e buffer: allow JSON indention 2024-02-29 18:58:07 +01:00
9320d6ec73 log: change default logging level back to 'info' 2024-02-29 18:58:07 +01:00
28e0c950b2 add more nullptr checks after memory allocations 2024-02-29 18:58:07 +01:00
068d8bca62 log: add preproc #if/#else to handle ABI incompatabilities in spdlog 2024-02-29 18:58:07 +01:00
5ad883c38b docker: use Fedora versions of fmtlib and spdlog 2024-02-29 18:58:07 +01:00
d1ecef233d fix includes and spdlog API 2024-02-29 18:58:07 +01:00
1ef0cc768c list: do not check state during intialization 2024-02-29 18:58:07 +01:00
e9a6f1b8c1 vfio: fix compilation for ARM targets 2024-02-29 18:58:07 +01:00
b32303b664 refactor: more code-style improvements 2024-02-29 18:58:07 +01:00
079abf2b51 refactor: whitespaces for references 2024-02-29 18:58:07 +01:00
054a130a4a vfio: move to new namespace 2024-02-29 18:58:07 +01:00
8421332706 pci: port to C++ 2024-02-29 18:58:07 +01:00
2c0e96797d fix unit-test 2024-02-29 18:58:07 +01:00
377db124e9 graph: make dump() use const CV 2024-02-29 18:58:07 +01:00
fd543b99b5 codestyle cleanups 2024-02-29 18:58:07 +01:00
3dd2dd9b1d log: increase log-level for static loggers 2024-02-29 18:58:07 +01:00
77ead61935 graph: fix typo 2024-02-29 18:58:07 +01:00
e43be50332 memory: rename default address spaces 2024-02-29 18:58:07 +01:00
faab634ee1 harmonize codestyle 2024-02-29 18:58:07 +01:00
97009ff624 vfio: fix mapping and remove legacy code 2024-02-29 18:58:07 +01:00
8e8c29ba6c plugin: do not store plugin name/desc in member variables 2024-02-29 18:58:07 +01:00
1595a39b2e plugin: add Registry::dumpList() 2024-02-29 18:58:07 +01:00
87788fa404 memory: add getter for memory graph 2024-02-29 18:58:07 +01:00
711b5781d0 fix CI 2024-02-29 18:58:07 +01:00
cf9e3ace4b ci: update Dockerfile 2024-02-29 18:58:07 +01:00
ca22438284 ci: use docker-in-docker for building Docker images 2024-02-29 18:58:07 +01:00
1b33e2d104 handle failed memory allocations 2024-02-29 18:58:07 +01:00
c77d34ee3a more refactoring to C++ 2024-02-29 18:58:07 +01:00
a03e914138 refactor malloc()/free() by new/delete 2024-02-29 18:58:07 +01:00
479b7f2388 refactor malloc()/free() by new/delete 2024-02-29 18:58:07 +01:00
a83ba7e6c6 tools: allow catching of more signal types 2024-02-29 18:58:07 +01:00
ab5064bb32 utils: allow catching more signal types 2024-02-29 18:58:07 +01:00
389c8d8e82 update copyright year to 2020 2024-02-29 18:58:07 +01:00
87285062e2 fix return code of kernel_set_nr_hugepages() 2024-02-29 18:58:07 +01:00
98c9cc3a7c fix location of FEIN pacakge repo 2024-02-29 18:58:07 +01:00
1624d15095 align C++ version with VILLASnode code 2024-02-29 18:58:07 +01:00
Sonja Happ
1ec2d88de9 only build unit tests of common if project is toplevel project 2024-02-29 18:58:07 +01:00
Sonja Happ
b8739a773a set initial values of hist class members in constructor; add a TODO case in put() function in for warmup==0 2024-02-29 18:58:07 +01:00
Sonja Happ
6a7bf85a48 add non-zero bucket and warmup parameters for histogram test 2024-02-29 18:58:07 +01:00
Sonja Happ
74759b0ee2 use Fedora 29 instead of 28, add missing spdlog package 2024-02-29 18:58:07 +01:00
4256d742e2 cmake: update required versions 2024-02-29 18:58:07 +01:00
e85fd6aa70 fix Log::getLevelName() 2024-02-29 18:58:07 +01:00
e6671719a1 cmake: add missing fmt include 2024-02-29 18:58:07 +01:00
e44a9a7cd5 remove spdlog submodule and use system version instead 2024-02-29 18:58:07 +01:00
4111166be9 fixes for armhf and aarch64 compatability 2024-02-29 18:58:07 +01:00
b00c69773b fix dangling bracket 2024-02-29 18:58:07 +01:00
8e5eca92eb fix typo and add an example for running in privileged mode 2024-02-29 18:58:07 +01:00
root
20f17bca42 docker changes 2024-02-29 18:58:07 +01:00
f3d710f121 hist: use more C++ constructs 2024-02-29 18:58:07 +01:00
91c62ce4e8 replace NULL by nullptr 2024-02-29 18:58:07 +01:00
edb54f3133 replace C-style headers with C++ C-compatability headers 2024-02-29 18:58:07 +01:00
4f9a45492e replace C-style headers with C++ C-compatability headers 2024-02-29 18:58:07 +01:00
129205c26f refactor enums to class enums 2024-02-29 18:58:07 +01:00
c719000edc popen: allow passing of new env variables, working directory and non-shell execution 2024-02-29 18:58:07 +01:00
Hatim Kanchwala
87327e868d Warn when kernel booted without IOMMU 2024-02-29 18:58:07 +01:00
Hatim Kanchwala
d3a3320cb2 Automatically load required kernel modules 2024-02-29 18:58:07 +01:00
fc0d363a66 add signal handler for SIGUSR1 to interrupt threads 2024-02-29 18:58:07 +01:00
ca1e944fce popen: add getter for pid 2024-02-29 18:58:07 +01:00
7d10faf76f hist: a few fixes and missing functions 2024-02-29 18:58:07 +01:00
55f7fc9392 hist: add default constructor 2024-02-29 18:58:07 +01:00
a9da5f159e fix issues with villas::utils namespace 2024-02-29 18:58:07 +01:00
8948e9c385 comment out unused function 2024-02-29 18:58:07 +01:00
6557caa9e3 hist: make details parameter boolean 2024-02-29 18:58:07 +01:00
3aff01814d popen: get file descriptor for read side stream 2024-02-29 18:58:07 +01:00
5cbf7a4a52 hist: port to C++ 2024-02-29 18:58:07 +01:00
f4dcbf4363 popen: added iostream-based bidirectional popen() 2024-02-29 18:58:07 +01:00
16b5048022 use custom base64 implementation and add unit tests 2024-02-29 18:58:07 +01:00
7875c6bf07 do not use villas::utils namespace by default 2024-02-29 18:58:07 +01:00
64f5d8b9c4 add const cast 2024-02-29 18:58:07 +01:00
6ac6ebda1c move crypto functions into utils 2024-02-29 18:58:07 +01:00
f7a60f9a8a change commenting style in header namespace 2024-02-29 18:58:07 +01:00
9fd791bbb8 remove C linkage 2024-02-29 18:58:07 +01:00
751e96e79c add missing includes 2024-02-29 18:58:07 +01:00
aa624d2240 move utils.h to utils.hpp 2024-02-29 18:58:07 +01:00
862f8c26af remove villas/atomic.h 2024-02-29 18:58:07 +01:00
4cf36aa19d remove extern "C" 2024-02-29 18:58:07 +01:00
Sonja Happ
2d4f5926fc window class: fixvalue assignment in constructor 2024-02-29 18:58:07 +01:00
d34e9f8d9b added new villas::Tool class as common top-level entrypoint 2024-02-29 18:58:07 +01:00
2c52f378a5 remove copyright 2024-02-29 18:58:07 +01:00
0e3e43005f moving_average_window: innherit from window class 2024-02-29 18:58:07 +01:00
ec9daf8d62 window: refactor steps -> length 2024-02-29 18:58:07 +01:00
4c4f0972ac window: fix hidden variable scope 2024-02-29 18:58:07 +01:00
e9a90cc1e5 list: fix indention 2024-02-29 18:58:07 +01:00
e94e8efc74 list: fix typo in variable names 2024-02-29 18:58:07 +01:00
631633888b list: added vlist_filter() to remove elements which dont match a condition 2024-02-29 18:58:07 +01:00
57962d8347 dsp: simplified moving average window 2024-02-29 18:58:07 +01:00
4037c0871b dsp: added infinitively long exponential window 2024-02-29 18:58:07 +01:00
7820fbfe0a rt: fix cpuset affinity 2024-02-29 18:58:07 +01:00
63184e555f fix invocation of Table::row() 2024-02-29 18:58:07 +01:00
08e7f4a0d5 window: add getters 2024-02-29 18:58:07 +01:00
339529ac6d dsp: started working on a moving average window 2024-02-29 18:58:07 +01:00
026f253e11 dsp: moved window to DSP namespace 2024-02-29 18:58:07 +01:00
0219236d00 dsp: add PID controller 2024-02-29 18:58:07 +01:00
Manuel Pitz
4b291a1c12 FIX: missing preprocessor #else and unused parameters 2024-02-29 18:58:07 +01:00
9df2b8538f refactor: NULL => nullptr 2024-02-29 18:58:07 +01:00
10c1b780b8 remove obsolete C file 2024-02-29 18:58:07 +01:00
65600fde0b move box drawing chars to boxes.hpp 2024-02-29 18:58:07 +01:00
4abea3a78f remove bitset 2024-02-29 18:58:07 +01:00
096d9ed80d remove hash_table 2024-02-29 18:58:07 +01:00
204cd148b7 use C++ compiler 2024-02-29 18:58:07 +01:00
fbb4a8e62d fix uninitialized fields 2024-02-29 18:58:07 +01:00
297822fba3 add myself as author 2024-02-29 18:58:07 +01:00
472c289bfa tests: fix signed/unsigned compare 2024-02-29 18:58:07 +01:00
969d87cb38 fix clang warnings 2024-02-29 18:58:07 +01:00
da64ef5f80 cmake: support build without libconfig 2024-02-29 18:58:07 +01:00
d074ca3683 add comments to #endif's 2024-02-29 18:58:07 +01:00
34546f2d75 remove dead code 2024-02-29 18:58:07 +01:00
ecd45fa0a6 cmake: reduce C++ version requirement 2024-02-29 18:58:07 +01:00
792e98874c utils: make SWAP() compatible with C++ 2024-02-29 18:58:07 +01:00
9f7457ee34 log: throw appropriate exceptions if parsing of logging configuration fails 2024-02-29 18:58:07 +01:00
6a179cdc46 exceptions: add parser exceptions and cleanup the other related exception classes 2024-02-29 18:58:07 +01:00
fe88938ef9 log: be strict when parsing logging configuration 2024-02-29 18:58:07 +01:00
b6f069700e log: remove obsolete LOG_LVL_STATS 2024-02-29 18:58:07 +01:00
6a9388918c exception: use dynamic memory for std::runtime_error::what() 2024-02-29 18:58:07 +01:00
300a0c283c refactor: use C-style commenting everywhere 2024-02-29 18:58:07 +01:00
0add7f16d8 utils: replace str() and strv() macros by functions to avoid compiler warnings 2024-02-29 18:58:07 +01:00
e6ccc0e3d1 add missing box drawing character 2024-02-29 18:58:07 +01:00
d02443e0d5 window: fix buffer overflow 2024-02-29 18:58:07 +01:00
594124e112 list: remove vlist_copy() 2024-02-29 18:58:07 +01:00
add21f9c12 common: add STATE_PREPARED 2024-02-29 18:58:07 +01:00
1ef09a7607 list: add vlist_{insert, remove, remove_all}() and corresponding tests 2024-02-29 18:58:07 +01:00
3259abd581 refactor: use strtok_r() instead of strtok() 2024-02-29 18:58:07 +01:00
5dad710d86 list: added vlist_copy() 2024-02-29 18:58:07 +01:00
ddb355908c added new class for moving window buffers 2024-02-29 18:58:07 +01:00
c3dd44b8d4 ci: fix location of unit test 2024-02-29 18:58:07 +01:00
fe413e09fa tests: move unit tests into subdir 2024-02-29 18:58:07 +01:00
fc726c0aca use exceptions instead of return codes for error handling 2024-02-29 18:58:07 +01:00
b456ac888b memory locking is now done at memory subsystem 2024-02-29 18:58:07 +01:00
15861d2285 terminal: fix intialization of terminal dimensions of no TTY is available 2024-02-29 18:58:07 +01:00
639e43b880 table: use UTF-8 box drawing characters 2024-02-29 18:58:07 +01:00
e821a7fbba added new states for shutdown 2024-02-29 18:58:07 +01:00
2db5ecd82a add compatability to CMake 3.7 2024-02-29 18:58:07 +01:00
c7a643aaa1 added compatability for 32bit ARM platforms 2024-02-29 18:58:07 +01:00
fbab53e28c added compatability for libjansson 2.9 2024-02-29 18:58:07 +01:00
12e4402698 fix missing include on older systems 2024-02-29 18:58:07 +01:00
68bcae45f0 tests: remove old log handler code 2024-02-29 18:58:07 +01:00
9c5cfc48f7 table: simplify rendering of tables 2024-02-29 18:58:07 +01:00
70d9b22453 log: fix broken log pattern 2024-02-29 18:58:07 +01:00
593bf46340 terminal: fix detection of window size 2024-02-29 18:58:07 +01:00
34b00a7b79 log: use C linking for legacy log functions 2024-02-29 18:58:07 +01:00
c6bfa7e940 table: simplify header 2024-02-29 18:58:07 +01:00
25a5cc1291 table: remove footer 2024-02-29 18:58:07 +01:00
0c711c79c9 utils: move killme() to C++ code in order to avoid global objects 2024-02-29 18:58:07 +01:00
aa1ce97a1f log: remove stats() 2024-02-29 18:58:07 +01:00
7d43a91796 disable warnings about unused return values 2024-02-29 18:58:07 +01:00
1098022fc1 fix compiler errors about non-trivial designated initializers with GCC 7 2024-02-29 18:58:07 +01:00
3a28cc1554 log: do not discard return values of vasprintf() 2024-02-29 18:58:07 +01:00
b8e92bdde9 log: remove static logger instances 2024-02-29 18:58:07 +01:00
2a27992a88 cmake: move thirdparty CMakeLists to subfolder 2024-02-29 18:58:07 +01:00
1c2f531c44 cmake: add SO name to libvillas-common 2024-02-29 18:58:07 +01:00
b08309ae9b cmake: add missing C++ headers when installing 2024-02-29 18:58:07 +01:00
dc6cfabbac update copyright year to 2019 2024-02-29 18:58:07 +01:00
78d51bc0ae utils: move copyright and version printing code into separate file 2024-02-29 18:58:07 +01:00
4b79f4a75f install villas-common library 2024-02-29 18:58:07 +01:00
9c63ab373d refactor: list_* -> vlist_* 2024-02-29 18:58:07 +01:00
168ceb052e fix logging 2024-02-29 18:58:07 +01:00
baa79225bd tsc: compile only on x86_64 2024-02-29 18:58:07 +01:00
05ea2840ea log: add Log::getLevelName() 2024-02-29 18:58:07 +01:00
e9fd4687b0 task: fix includes for tsc 2024-02-29 18:58:07 +01:00
2cadb5a98f use better heuristic for compile-time cache line size 2024-02-29 18:58:07 +01:00
6c279280f7 indention and whitespaces 2024-02-29 18:58:07 +01:00
21e05c2aa7 do not throw dynamically allocated exceptions 2024-02-29 18:58:07 +01:00
15984f460c add state_print() function 2024-02-29 18:58:07 +01:00
a39aafa12c add new state 2024-02-29 18:58:07 +01:00
d8dcefd375 refactor: use of auto 2024-02-29 18:58:07 +01:00
fd3097eedf log: fix intialization of log level and pattern 2024-02-29 18:58:07 +01:00
4419d49657 log: add Log::setPattern() 2024-02-29 18:58:07 +01:00
8a9525e226 cmake: properly set options of sub projects 2024-02-29 18:58:07 +01:00
956a1135e8 log: reduce lookups in logger registry 2024-02-29 18:58:07 +01:00
ed250bb433 rt: harmonize logging messages 2024-02-29 18:58:07 +01:00
edb122ae58 log: add getter for log level 2024-02-29 18:58:07 +01:00
9e088a8e3d log: throw exception for unknown log levels 2024-02-29 18:58:07 +01:00
0333a4e47e link fmtlib relocatable 2024-02-29 18:58:07 +01:00
decd60fe3e fix possibibly unitialized value 2024-02-29 18:58:07 +01:00
bee032a333 hist: fix invalid min value 2024-02-29 18:58:07 +01:00
4a1aa2c4b7 refactor: warn() => warning() 2024-02-29 18:58:07 +01:00
272d90ac4f task: several portability improvements for macOS 2024-02-29 18:58:07 +01:00
00964eb119 tests: fix unit tests 2024-02-29 18:58:07 +01:00
2715944793 list: fix portability issues of list_sort() os BSD-based systems 2024-02-29 18:58:07 +01:00
08e3ea78ea cmake: rdtsc is only supported on x86 2024-02-29 18:58:07 +01:00
6517dbb39d whitespaces 2024-02-29 18:58:07 +01:00
e22f08e3dd kernel: inprove portability 2024-02-29 18:58:07 +01:00
660ffd6769 tsc: inline calls to tsc_now() 2024-02-29 18:58:07 +01:00
729fe8102e timing: add new function to compare timestamps 2024-02-29 18:58:07 +01:00
9fd43318c4 smaller fixups 2024-02-29 18:58:07 +01:00
b43c494c3f terminal: add new terminal class 2024-02-29 18:58:07 +01:00
76257eb0a8 tests: rewrote unit tests 2024-02-29 18:58:07 +01:00
0cc18919a9 utils: move include 2024-02-29 18:58:07 +01:00
591cfd5a03 refactor: NULL -> nullptr 2024-02-29 18:58:07 +01:00
39bbbca283 rewrite logging system with spdlog 2024-02-29 18:58:07 +01:00
25d4d942e6 kernel: improve compatability for RPi 2024-02-29 18:58:07 +01:00
5f3ee7c8cb task: use new tsc module 2024-02-29 18:58:07 +01:00
d516f84026 undefine some macros which are already defined by macOS SDK 2024-02-29 18:58:07 +01:00
3258d9947e list: remote LIST_INIT() macro 2024-02-29 18:58:07 +01:00
a6ef5ba8b8 tsc: fix typo 2024-02-29 18:58:07 +01:00
094b4aa9f2 rt: ported to C++ 2024-02-29 18:58:07 +01:00
0ef4957de9 added new classes for custom exceptions 2024-02-29 18:58:07 +01:00
5066bd167a kernel: partial port to C++ 2024-02-29 18:58:07 +01:00
9bc51cdcec utils: partial port to C++ 2024-02-29 18:58:07 +01:00
449d9e26a4 add fmtlib as submodule 2024-02-29 18:58:07 +01:00
5c023df352 added new JsonBuffer class which will obsolete struct buffer 2024-02-29 18:58:07 +01:00
08ed946831 plugin: remove dump() method from registry 2024-02-29 18:58:07 +01:00
8cd19c1499 kernel: remove obsolete { } 2024-02-29 18:58:07 +01:00
f06e511b1d tests: fix advio tests 2024-02-29 18:58:07 +01:00
b502838b07 whitespace cleanups 2024-02-29 18:58:07 +01:00
c9c8eeacf5 cmake: add spdlog via add_subdirectory() 2024-02-29 18:58:07 +01:00
3d88c5b67d add libconfig to dependencies 2024-02-29 18:58:07 +01:00
c7a389888c add editorconfig 2024-02-29 18:58:07 +01:00
79a2d125d8 cmake: improve version detection and generation of config.h 2024-02-29 18:58:07 +01:00
f6b6714aa1 remove criterion submodule 2024-02-29 18:58:07 +01:00
c4c20fde5a ci: add missing dependencies 2024-02-29 18:58:07 +01:00
c795b56e67 plugin: rewrite 2024-02-29 18:58:07 +01:00
d0e507c3ac cmake: fix invalid paths 2024-02-29 18:58:07 +01:00
700b12bcdf update spdlog submodule 2024-02-29 18:58:07 +01:00
9b8b1a7936 tests: port unit tests to C++ 2024-02-29 18:58:07 +01:00
0c7d7e1003 log: add option to add a callback to C logging subsystem 2024-02-29 18:58:07 +01:00
f4d28262af tsc: add missing extern "C" declaration 2024-02-29 18:58:07 +01:00
701c4889b5 hash_table: allow constant key 2024-02-29 18:58:07 +01:00
1a80b87409 fix compilation on linux 2024-02-29 18:58:07 +01:00
789bcea6c1 introduce new PORJECT_* macros 2024-02-29 18:58:07 +01:00
2dd2a530a1 moved more code from VILLASnode to VILLAScommon 2024-02-29 18:58:07 +01:00
83dfaa00d8 refactor: change project name from VILLAS{fpga,node} to VILLAScommon 2024-02-29 18:58:07 +01:00
6780cc1077 fix Criterion dependency 2024-02-29 18:58:07 +01:00
afd15cf17e fix Jansson dependency 2024-02-29 18:58:07 +01:00
8ea4016803 fix compilation on non Linux targets 2024-02-29 18:58:07 +01:00
1ca73d018c merge changes from VILLASfpga/feature/hls-rtds2gpu 2024-02-29 18:58:07 +01:00
5b906aa3ea move more common code from VILLASfpga repo 2024-02-29 18:58:07 +01:00
652f9cf2a5 cmake: link against DL 2024-02-29 18:58:07 +01:00
a8bdf9292b cmake: use proper include dirs 2024-02-29 18:58:07 +01:00
c1ed2a9a55 cmake: rename unit-test target to avoid name collision with parent projects 2024-02-29 18:58:07 +01:00
3b5ee46258 enable unit-tests in CI 2024-02-29 18:58:07 +01:00
50ede4fe19 add COPYING.md 2024-02-29 18:58:07 +01:00
830f73e4fb initial commit 2024-02-29 18:58:07 +01:00
5c90529f90 Remove VILLAScommon submodule
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-29 18:58:07 +01:00
d455faf000 Fix REUSE compliance
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-28 02:33:22 +01:00
0e0b877335 nix: Fix REUSE dep5 file with new flake.lock location
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-28 02:33:22 +01:00
92243036f1 nix: Add NixOS module for villas-node
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-28 02:33:22 +01:00
24e8fe62b9 openapi: Remove trailing whitespaces
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-28 02:33:22 +01:00
4668d06d81 openapi: Fix default value of idle_stop setting
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-28 02:33:22 +01:00
5ae4bc772f nix: Update flake inputs
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-28 02:33:22 +01:00
eb15e83a31 nix: Fix comment capitalization in .nix files
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-28 02:33:22 +01:00
1f756ac49e nix: Move flake to top-level path
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-28 02:33:22 +01:00
b573644133 Remove obsolete SuperNode::getConfigUri()
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-27 19:19:27 +01:00
9247846805 exec: Pass name of node and config path via environment variable to sub-process
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2024-02-27 19:19:27 +01:00
Niklas Eiling
49523a5076 fpga: remove std::filesystem and properly retrieve searchPath from
configPath

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-27 13:40:12 +01:00
Niklas Eiling
ea0bfcf7f4 fpga: clean up debug outputs
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-27 13:40:12 +01:00
Niklas Eiling
26e22ca6f4 fpga: make implementation compatible with new createCard interface
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-27 13:40:12 +01:00
Niklas Eiling
7ced0c5f0a update common subrepo
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-27 13:40:12 +01:00
Niklas Eiling
47362ccede fpga: enable inline config of card
additionally to configuring the card in a separate block, we need to be
able to configure the card from the node config to enable libvillas
users to use the fpga node-type.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-27 13:40:12 +01:00
Niklas Eiling
81ff679b41 node: add configPath member
we need the path of the config file in the nodes in case we want to
parse a separate sub-config with relative path names. This is required
for the fpga node type to parse the ips config file from Fpga::parse.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-27 13:40:12 +01:00
Niklas Eiling
08f109b924 update fpga subrepo so we can use the new std::filesystem free API
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-26 17:10:57 +01:00
Steffen Vogel
226ccecd19 Remove usage of std::filesystem
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-26 17:10:57 +01:00
Niklas Eiling
542132de92 add API for createCards without std::filesystem
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-26 16:53:38 +01:00
Niklas Eiling
033634ac47 register: ignore strict aliasing for setting register as float
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-26 15:39:27 +01:00
Niklas Eiling
8a40b873be register: fix wrong fomatter declaration
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-26 15:11:58 +01:00
Niklas Eiling
d24a323e5c utils: remove cards from createCard
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-26 11:50:44 +01:00
Niklas Eiling
a3209aa344 use polling instead of interrupt
but keep interrupts for i2c

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-26 11:50:44 +01:00
Niklas Eiling
d588f5f2a2 dino: use enum instead of literal for GAIN
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-26 11:50:44 +01:00
Niklas Eiling
fb742dddd1 register: increase register num to 8
the VHDL changed so we need to change register here too

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-26 11:50:44 +01:00
Niklas Eiling
4b7ed781c0 card: add API to create a single card
this is a preparation for allowing defining the card in the node config
rather than separately.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-26 11:50:44 +01:00
Niklas Eiling
ee068621e6 ips/register: add default config for Dino
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-14 14:20:33 +01:00
Niklas Eiling
dc270de8f0 update common subrepo
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-14 14:20:33 +01:00
Niklas Eiling
d54e4eb3f0 ips/register: add IP for the new register interface
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-14 14:20:33 +01:00
Niklas Eiling
1bb6c221f6 ips/dma: fix memory leak in libxil code by explicitly calling free on
CyclicBd

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-14 14:20:33 +01:00
Niklas Eiling
b0ccbddc6f card: call stop on all ips when destructor is called
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-14 14:20:33 +01:00
Niklas Eiling
c730412e98 ips/intc: move deinit to stop instead of destructor
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-14 14:20:33 +01:00
Niklas Eiling
2c72af935a ips/i2c: move deinit to stop instead of destructor
accessing register space from destructor can cause use after free errors

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-14 14:20:33 +01:00
Niklas Eiling
2a74f7e8c2 add register interface to dino bitstream and make the necessary changes
to jsons and hwh parser

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-14 14:20:33 +01:00
Steffen Vogel
272a3fac36 Fix include order
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-14 10:09:52 +01:00
Steffen Vogel
c1410ef8a8 Fix formatting using clang-format
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-14 10:09:52 +01:00
Steffen Vogel
0be29ffcab python: Pin dependencies
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-13 16:23:02 +01:00
Steffen Vogel
b4fcd0c566 decvontainer: Fix formatting
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-13 16:23:02 +01:00
Steffen Vogel
dd72179a35 python: Fix formatting
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-13 16:23:02 +01:00
Steffen Vogel
e30e361c31 devcontainer: Do not use unsupported variable substitution
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-13 16:23:02 +01:00
Steffen Vogel
9b3a33f31b Remove unused C++20 include which breaks build on C++17 compilers
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-13 16:23:02 +01:00
Steffen Vogel
2f15e151b4 deps: Do now show Git warning about detached HEAD state
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-13 16:23:02 +01:00
Steffen Vogel
d544ab70bc Fix typo in README
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-13 16:23:02 +01:00
Niklas Eiling
f699179ef7 add docker tag to reuse step
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-08 11:19:51 +01:00
Niklas Eiling
eeb933854c update fpga subrepo
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-08 11:19:51 +01:00
Niklas Eiling
eb450eb650 update common and fpga submodules
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-08 11:19:51 +01:00
Niklas Eiling
4ca9c88bd0 fpga: add note about wrong cast
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-08 11:19:51 +01:00
Niklas Eiling
97a391c271 update fpga submodule
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-08 11:19:51 +01:00
Niklas Eiling
18aa0c8862 rework fpga node type
The various changes in fpga require a rewrite of the fpga node type.
To allow relative paths for the fpga config file, Config and SuperNode
had to be modified so they store the path of the main config file.
The syntax of the fpga node type configuration has changed - the example
config in etc has been modified accordingly.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-08 11:19:51 +01:00
Niklas Eiling
f09e6e909b fix possible segfault due to non-functional range check with unsigned int
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-08 11:19:51 +01:00
Niklas Eiling
535560d39d ci: fix errors when building docker container on non-master branch
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-07 18:21:45 +01:00
Niklas Eiling
a0fc73f2ee villas-fpga-ctrl: return to old loggers
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-07 18:21:45 +01:00
Niklas Eiling
6e1783612d ips/intc: remove access to xilinx driver in case we are using VFIO
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-07 18:21:45 +01:00
Niklas Eiling
d6fd533f0c ips/dma: make interrupt handling more robust
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-07 18:21:45 +01:00
Niklas Eiling
e505bfb5d9 ips/dma: reformat and make more robust
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-07 18:21:45 +01:00
Niklas Eiling
13ba256e4a update common submodule
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-07 18:21:45 +01:00
Niklas Eiling
f2db38fe44 ip/switch: reformat and add function that prints current switch config
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-07 18:21:45 +01:00
Niklas Eiling
7c6d350eb0 format and increase robustness of interuppt handling
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-07 18:21:45 +01:00
Niklas Eiling
edb996ebfd add fmt::formatter for Dino::IoextPorts
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-02-07 18:21:45 +01:00
Niklas Eiling
645429b9c8 lib/CMakeLists.txt: fix error in syntax
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-12 12:01:51 +01:00
Niklas Eiling
b2fcfeaa67 move more of the switch configuration boilerplate into ConnectString
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-12 11:46:59 +01:00
Niklas Eiling
147725daef libvillas-fpga.so: only link with stdc++fs for gcc8 and earlier
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-12 11:46:59 +01:00
Niklas Eiling
ca6c70e09b ConnectString: Make channel data type more generic
we can not only connect Aurora channels to the switch so use Node
instead as the data type

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-12 11:46:59 +01:00
Niklas Eiling
1c2d8e440b update and reformat villas-fpga-ctrl
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
897d916886 Core/Card: enable IP init requiring other IPs
add initialized IP to card->ips already during initialization so that
later IPs can use early initiliazed IPs to do their initilization.
E.g. Dino needs I2c for initialization.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
8b95182b08 automatically configure and test Dino based on hwdef json
this currently requires manually adding the mapping of Dinos to i2c
buses in the fpga json.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
b5682290c2 I2c: use Switch::selfTest to check i2c bus
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
d4a868ae7c Dino: add debug output for direction registers of io extender
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
db062f08bd Dino: overload operator>> for IoextPorts
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
60c65c2880 verify more assumptions in i2c
add selftest to I2c and readback Dino configuration to verify it was
actually set

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
335dd2c0ce fix bug where Dino IP always read 0 from i2c. Add hardware mutex to I2c
and to I2c::Switch

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
acaa4dd9de improve i2c IP
more code reuse, add function for reading from a register i.e. combined
write and read

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
08b666a548 make I2c destructor call to I2c::reset explicit
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
dbe4e4e472 add i2c configuration logic to dino IP
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
810b1259f8 fix double start of i2c bus driver and move channel map to header
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
48846ace39 i2c: add handling of BusNotBusy interrupt on reads. add retrying of
channel reads in case inconsistent state was detected.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
f086c325c2 link with stdc++fs to avoid compiler error on newer gcc versions
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
57177c074e fix several issues with i2c implementation and add support for
interacting with i2c switches

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
2d51deea0c remove vfio container intitialization from setupFPGACard
this lead to double creation of the vfio container

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
3e74c0d7a4 remove linking to libjansson from libvillas-fpga because this is already
included in libvillas-common.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
1578a26915 i2c: fix missing getMemoryBlocks method leading to unmapped memory
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
d34ab182e4 fix unmapped ring buffers in dma.cpp leading to segfault
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
e93b8e998d fix IPs without stream port causing an error and fix formatting in
node.cpp

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
bd1f32da7b fix fomatting in core.cpp
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
64d5a6ba42 fpgas.json: switch to new json per default and fix the same
use fpga definition that includes dino and i2c controller to use the
latest bitstream (vc707-xbar-pcie-dino).
Fix the json for that bitstream to also include the interrupt
controller.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
3e64e5d238 hwdef-parse.py: add interrupt controller added as module_ref to
whitelist

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
7e07da6e60 add i2c ip draft
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
0138119bff copy new editorconf from node
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2024-01-09 17:14:05 +01:00
Niklas Eiling
d61337023e add draft for i2c drvier implementation
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-12-13 15:17:26 +01:00
Niklas Eiling
ba71f6384f hwdef-parse.py: add SPDX compliant license info
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-12-13 15:11:26 +01:00
Niklas Eiling
4f4312127d add json for vc707-xbar-pcie-dino
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-12-13 15:11:26 +01:00
Niklas Eiling
ada7cac017 hwdef-parse.py: whitelist iic and DINO IPs
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-12-13 15:11:26 +01:00
Niklas Eiling
e2382c643b add hwdef-parse script from hardware repo
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-12-13 15:11:26 +01:00
Niklas Eiling
2967fb8ac9 fix fpga.cpp unit test failing due to changed DeviceList interface
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-12-12 14:08:34 +01:00
Niklas Eiling
654ee84e9e make FPGA device interface agnostic
remove explicit mentioning of PCIe in the use of Device as a preparation
for integrating platform devices. auto formatted some files.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-12-12 14:08:34 +01:00
Niklas Eiling
7ce1ee5a6c make villas-fpga-ctrl accept multiple connect strings
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-12-12 14:08:34 +01:00
Niklas Eiling
804f3eea29 update common subrepo
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-12-12 14:08:34 +01:00
Philipp Jungkamp
c3d991b23e python: Add digest-hook fifo format parsing
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-29 11:09:27 +02:00
Philipp Jungkamp
b90c5d9c77 Update submodules
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-26 17:59:39 +02:00
Philipp Jungkamp
9adf7931f1 src: Suppress cppcheck false positive
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-26 17:59:39 +02:00
Philipp Jungkamp
b1e9407f83 packaging-nix: Update inputs
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-26 17:59:39 +02:00
Philipp Jungkamp
33cd6165df Fix fmt 10.0.0 related formatting errors.
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-26 17:59:39 +02:00
Philipp Jungkamp
e2c2ec2c8b Fix fmt 10.0.0 related formatting errors.
Signed-off-by: Philipp Jungkamp <p.jungkamp@gmx.net>
2023-09-26 17:00:31 +02:00
Philipp Jungkamp
86bba9c5e8 python: Always use UTC time when handling Timestamps
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-21 14:46:54 +02:00
Philipp Jungkamp
396dd7642e ci: Check Python code with black and mypy
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-21 14:46:54 +02:00
Philipp Jungkamp
44b5a12171 python: Rework Python Sample and Format interfaces
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-21 14:46:54 +02:00
Philipp Jungkamp
fabedbcc73 editorconfig: Cover more files.
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-21 14:46:54 +02:00
Philipp Jungkamp
c863089e4b packaging-nix: Add villas-python package
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-21 14:46:54 +02:00
Philipp Jungkamp
f9853f52c7 hook-digest: Add integration test
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
7623af56c7 hook-frame: Add integration test
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
25601efa54 hook-reorder_ts: Add integration test
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
54d3f51afb format-villas.human: Add NEW_FRAME flag to format
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
c49e339ad1 Don't overwrite sample flags during path sample muxing.
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
b70704f2d4 format-json: Include flags in serialization.
Include the SampleFlags::NEW_FRAME and NEW_SIMULATION flags in the
JSON serialization of samples.

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
043ff81eb5 Fix SampleFlags HAS_ALL and NEW_FRAME
SampleFlags::HAS_ALL was not including the NEW_* style flags.
The NEW_SIMULATION flag is now independent from the NEW_FRAME flag,
since the dependency made checking that flag unnecessarily difficult.

Checking a composite flag like this

 if ((smp->flags & SampleFlags::NEW_SIMULATION) == SampleFlags::NEW_SIMULATION);

is more verbose than checking a simple flag like

 if (smp->flags & SampleFlags::NEW_SIMULATION);

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
065de3ab6d hook-digest: Add hook for computing digests
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
c2eefabb93 hook-frame: Add hook to add SampleFlags::NEW_FRAME annotations
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
79077c9bb9 Add NEW_FRAME to SampleFlags
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
97b769a80d Replace SampleFlags IS_FIRST/IS_LAST with NEW_SIMULATION
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
f583b04d15 packaging-nix: Add reuse compliance checker
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Philipp Jungkamp
99c13ba45c packaging-nix: Add clang-tools to dev environment
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-19 19:07:22 +02:00
Steffen Vogel
c0edadcf79 Update VILLAScommon submodule
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
46266e85de Add script to format all files in repository
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
6eb52161e5 Add missing REUSE headers
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
935e73cc41 Add clangd and clang-format VSCode extensions to Devcontainer
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
6333615565 Add clangd configuration file
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
926ae841a8 Fix broken include due to auto-formatting
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
6e8d4f860d Fix wrong package in Ubuntu Dockerfile
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
87b16ed25c Update contribution guide
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
1e19777798 Add .git-blame-ignore-revs to hide large refactorings commits from git blame
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
f61c7d9b8f Fix formatting of Dockerfiles
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
2f8511c818 Add Git .mailmap file
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
2626ac2e48 Add pre-commit hook for clang-format
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
02a2aa4f94 Apply clang-format changes
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
8da1e68b0f Add clang-format config
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
bc3ad552f5 Make editorconfig compatible with clang-format
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
37dec5c55d Install clang-format and clangd in Devcontainers
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:37:42 +02:00
Steffen Vogel
157d5b21d7 Make REUSE copyright notice the same as in other VILLASframework projects and fix comments (#82)
This edits the headers in every file so the copyright notice mentions RWTH Aachen University. We also update some copyright years and fix various comments so the header is the same across all of VILLASframework.

* Harmonize comment and code-style

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>

* Harmonize comment and code-style

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>

---------

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-08 11:35:18 +02:00
Niklas Eiling
c2176113d7 update libxil submodule
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-09-08 11:24:43 +02:00
Steffen Vogel
6db1ab53ef Revert update fpga submodule
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
fd0480f3c7 Remove "make doc" from Dockerfiles
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
7d2f073075 Fix REUSE compliance for reorder hook
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Philipp Jungkamp
73ca4b5c8d Replace remaining C style comments
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
66923380fb Update VILLAScommon sub-module
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
82975ddaaa Fixup whitespaces
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
57d5ed8e55 Move SPDX header to top of README file
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
45b6f602dc Fix file header of queue.hpp
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
a9805327ae Removed Doxygen from repo
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
bee65579d7 Use #-style comments in .conf files
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
de3f95c8e4 Remove accidentially committed example configs
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
e2ae1089d9 Move SPDX comment behind DOCTYPE tag
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
527a87d9ed Add missing RWTH copyright to main README.md
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
bd47601630 Delete outdated CHANGELOG.md
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
626e77557a Apply suggestions from Philipps code review
Co-authored-by: Philipp Jungkamp <56401138+PJungkamp@users.noreply.github.com>
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
3cc212423e Fix more flake8 warnings
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
bbb3cfe240 Remove more Doxygen-style comments
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-09-07 11:16:04 +02:00
b5f554d828 Ignore too long lines in flake8 linter
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-09-07 11:16:04 +02:00
68654f95f2 Add periods after file headers and fix email addresses
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-09-07 11:16:04 +02:00
Steffen Vogel
0735eb0f89 Make project REUSE compliant
And various other cleanups and harmonizations

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Steffen Vogel
78727be952 Use C++ style comments
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00
Philipp Jungkamp
f03579df2f hook-reorder-ts: Add OpenAPI specification
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-30 14:57:05 +02:00
Steffen Vogel
636dee213c Fix code-style
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-08-30 14:57:05 +02:00
Philipp Jungkamp
26887f00ff hook-reorder-ts: Fix code-style
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-30 14:57:05 +02:00
Philipp Jungkamp
aa3e08ae64 hook-reorder-ts: Add example for 'reorder_ts' hook
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-30 14:57:05 +02:00
Philipp Jungkamp
bde1582348 hook-reorder-ts: Add hook to fix reordered samples
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-30 14:57:05 +02:00
Steffen Vogel
4b433e20fd Fix include order
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-08-30 13:32:55 +02:00
Steffen Vogel
932ee22472 modbus: Expose socket descriptor to netem emulation
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-08-30 13:32:55 +02:00
Steffen Vogel
950b8a929d deps: Install libmodbus
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-08-30 13:32:55 +02:00
Steffen Vogel
7453681ebd deps: Fix interactive mode
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-08-30 13:32:55 +02:00
Steffen Vogel
7a84a6494f deps: Harmonize URL suffixes
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-08-30 13:32:55 +02:00
Philipp Jungkamp
b9bad1219d tests: Fix multiplexing test assuming implicit truncate
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-25 18:30:27 +02:00
Philipp Jungkamp
ad6bd0ecf7 node-file: Don't truncate files
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-25 18:30:27 +02:00
Philipp Jungkamp
65cb2d612b doc: Add OpenAPI specification for modbus node-type
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-24 11:19:19 +02:00
Philipp Jungkamp
2a82e7b388 node-modbus: Improve _read and _write loop
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-23 16:29:53 +02:00
Philipp Jungkamp
a95c4af822 node-modbus: Add details and improve description
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-23 16:29:53 +02:00
Philipp Jungkamp
132fe1c92d node-modbus: Add comments to the modbus node example configuration
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-23 16:29:53 +02:00
Philipp Jungkamp
f229d042d4 node-modbus: Fix code-style
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-23 16:29:53 +02:00
Philipp Jungkamp
893aeaa12e packaging: Add libmodbus to Distro Dockerfiles
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-23 16:29:53 +02:00
Philipp Jungkamp
5aacd5f49e node-modbus: Add initial modbus support
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-23 16:29:53 +02:00
Philipp Jungkamp
53848f5345 packaging-nix: Fix code-style and capitalization
Co-authored-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Philipp Jungkamp <56401138+PJungkamp@users.noreply.github.com>
2023-08-23 16:29:53 +02:00
Philipp Jungkamp
391bff5993 web: Fix code-style
Co-authored-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Philipp Jungkamp <56401138+PJungkamp@users.noreply.github.com>
2023-08-23 16:29:53 +02:00
Philipp Jungkamp
82272fc7e6 api: web: Do proper shutdown if startup was interrupted
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-23 16:29:53 +02:00
Philipp Jungkamp
9c94b31057 packaging-nix: Add debug info to dependencies in devShells
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-23 16:29:53 +02:00
Philipp Jungkamp
7117dc601f packaging-nix: Update nix flake
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-08-23 16:29:53 +02:00
Steffen Vogel
5185c25ba7
Merge pull request #694 from VILLASframework/update-fpga
update fpga submodule
2023-07-25 20:12:12 +02:00
Steffen Vogel
a872c64fbd
Merge pull request #695 from VILLASframework/codeowners
add CODEOWNERS
2023-07-25 20:11:30 +02:00
Niklas Eiling
56bc6bade0 add CODEOWNERS
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-07-25 18:42:44 +02:00
Niklas Eiling
00d72982a0 update fpga to make ci happy
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-07-25 18:26:49 +02:00
Niklas Eiling
a5991bc794 deactivate stric-aliasing for cast
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-07-25 18:26:19 +02:00
Niklas Eiling
554515fe30 fix fpga node type to work with current fpga master
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-07-25 18:16:51 +02:00
Niklas Eiling
568c009ca8 update fpga submodule
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-07-25 17:44:22 +02:00
Niklas Eiling
c84df46d9e update libxil submodule, adding correct install path for libxil
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-07-25 17:36:01 +02:00
Steffen Vogel
6d9a678d3d
Merge pull request #690 from VILLASframework/deps.sh
Improve deps.sh install selection
2023-07-10 10:23:36 +02:00
Steffen Vogel
606330e14c
Merge pull request #688 from VILLASframework/fix-docs-link
Fix link to documentation in README
2023-07-10 10:11:41 +02:00
5adf593f18 Code-style cleanups to deps.sh script
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-07-10 10:09:30 +02:00
Steffen Vogel
6e19dec1bb
Merge pull request #693 from VILLASframework/cmake-minimal
Allow minimal CMake build configuration
2023-07-10 09:54:45 +02:00
Philipp Jungkamp
c07ec133f0 cmake: Allow simple minimal builds
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-07-07 12:09:12 +02:00
Manuel
a553bc53a1
Merge pull request #689 from VILLASframework/dumper
Dumper move socket nameing from constructor to method
2023-07-06 20:31:00 +02:00
Manuel Pitz
7b39c92b91 dumper: fix style for cppcheck
Signed-off-by: Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
2023-07-06 20:01:11 +02:00
Manuel Pitz
85ab9f2100 dumper: fix initalization list
Signed-off-by: Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
2023-07-06 19:36:22 +02:00
Philipp Jungkamp
4803033b9c Fix cmake libre pkg-config import
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-07-06 17:51:27 +02:00
Philipp Jungkamp
8d70845d91 Improve deps.sh install selection
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-07-06 17:07:39 +02:00
Manuel Pitz
9c0517cb74 dumper: fix styles for steffen
Signed-off-by: Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
2023-07-06 11:59:58 +02:00
Manuel Pitz
70d00ba774 dumper: add function for naming the socket
Signed-off-by: Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
2023-07-06 11:53:58 +02:00
Manuel Pitz
536b39e96d hook: pmu_dft clenaup ifdefs for dumper
Signed-off-by: Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
2023-07-06 11:53:36 +02:00
Steffen Vogel
9ecfe61acd
Fix link to documentation in README
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-07-06 11:05:34 +02:00
Steffen Vogel
e7e168d5f2
Merge pull request #686 from VILLASframework/webrtc-new-signaling
Refactor WebRTC signaling and Node UUID initialization
2023-07-01 00:13:47 +02:00
Philipp Jungkamp
d37b1ba171 packaging-nix: Update common submodule in flake.lock
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-30 18:47:45 +02:00
Philipp Jungkamp
ddc8ffaa12 packaging-nix: Add integration test dependencies to devShells
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-30 18:47:27 +02:00
Philipp Jungkamp
d0f1ac749a node-loopback: Fix json_unpack call in parse
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-30 18:21:27 +02:00
Philipp Jungkamp
61d5133a40 node-loopback: Fix missing Node::parse call
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-30 18:07:32 +02:00
Philipp Jungkamp
82bf4df50c node-webrtc: move peer member initialization to initializer list
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-30 14:06:48 +02:00
Steffen Vogel
352c5996db Fix buffer overflow in UUID handling
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-30 13:26:26 +02:00
Steffen Vogel
7c32617ead Remove unused includes
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-30 12:59:02 +02:00
Steffen Vogel
50b02df5fd webrtc: Remove unused overload
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-30 11:53:29 +02:00
Steffen Vogel
82ea02884d webrtc: Show provide status about the RTCPeerConnection via the REST API
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-30 11:53:29 +02:00
Philipp Jungkamp
7ad3dff578 Remove obsolete uuid_t parameter from villas-signal
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-30 11:45:38 +02:00
Philipp Jungkamp
f73efabd18 Adapt fpga node to changed uuid passing
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-30 11:30:05 +02:00
Steffen Vogel
cf5ef3927c Remove more left-overs from Go node-type
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-30 10:55:48 +02:00
Steffen Vogel
4d43b72d78 webrtc: Use UUID name as signaling peer by default
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-30 10:51:40 +02:00
Steffen Vogel
7749a3a922 No not pass super-node UUID to Node::parse() any longer
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-30 10:51:01 +02:00
Steffen Vogel
d57a5d3306 Refactor parameter name for parse() from cfg to json
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-30 10:48:43 +02:00
Steffen Vogel
e20bd664d9 Harmonize libjansson format strings
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-29 08:15:49 +02:00
Steffen Vogel
f409e05c35 Refactor naming of json_t variables
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-29 08:15:49 +02:00
Steffen Vogel
31eabd7b9d webrtc: Refactor {to,from}JSON() to {to,from}Json()
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-29 08:15:05 +02:00
Steffen Vogel
294af6aaca webrtc: Send signaling list
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-29 07:56:43 +02:00
Steffen Vogel
20dc83bee4 webrtc: Add peer option
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-29 07:56:43 +02:00
Steffen Vogel
94636e8b09 webrtc: Renamed signaling connection to peer
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-29 05:48:02 +00:00
Steffen Vogel
0445d671dc
Merge pull request #677 from VILLASframework/packaging-nix
Disable warning as error for normal release builds
2023-06-23 19:17:37 +02:00
Steffen Vogel
da0a73c39b
Merge pull request #680 from VILLASframework/fix-leaks
Fix memory and synchronization issues
2023-06-23 19:16:13 +02:00
Philipp Jungkamp
3baf5a410f queue: Fix incorrect signalling on queue push
Pushing zero values to a CQueueSignalled should't wake the
synchronization mechanism.

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-23 14:04:06 +02:00
Philipp Jungkamp
f1c7e0f2a8 path: Fix leaking samples
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-23 13:02:55 +02:00
Philipp Jungkamp
b9c8ffce5b node-iec60870: ignore -Wmaybe-uninitialized false positive
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-23 12:00:08 +02:00
Philipp Jungkamp
4224f72ecb cmake: disable warning as error on default release builds
A new warning introduced by the compiler on a target system should not
break the build on that target.
You can override that behaviour using VILLAS_COMPILE_WARNING_AS_ERROR.

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-23 11:53:01 +02:00
Philipp Jungkamp
cd5a99df67 packaging-nix: fix cross-compilation
Update nixpkgs for upstream libre cross compilation fix.
Use minimal systemd dependency for mosquitto and rdma-core.

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-23 11:53:01 +02:00
Philipp Jungkamp
4c662ff56a packaging-nix: Add criterion to devShells to allow building unit-tests
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-23 11:51:55 +02:00
Philipp Jungkamp
0cb4ac79d5 unit-tests: intialize global test params at runtime
Move the intialization of the paramters to runtime by converting the
static array to a vector and filling it when critirion calls the test
setup.

Global variable initialization order across translation units is not
defined.
Referring to e.g. the memory::mmap global variable in the initialization
of the static unit test parameter set may leave an incorrect address in
the struct param.

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-23 11:33:34 +02:00
Steffen Vogel
f77231f2a7
Merge pull request #676 from VILLASframework/fix-ci-cmake
ci: Use uniform cmake invocation
2023-06-21 16:35:52 +02:00
Steffen Vogel
d294e8fff3
Merge pull request #675 from VILLASframework/fix-webrtc
Fix webrtc
2023-06-21 16:33:18 +02:00
Steffen Vogel
3d6e5204ff
Merge pull request #674 from VILLASframework/fix-amqp
node-amqp: Handle moved include dir of rabbitmq-c
2023-06-21 16:32:23 +02:00
Steffen Vogel
ad6de61766
Merge pull request #673 from VILLASframework/build-vscode-devcontainer-image
ci: Build and push VSCode devcontainer image in CI
2023-06-21 16:31:18 +02:00
Philipp Jungkamp
99bad50d6b ci: Use uniform cmake invocation
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-21 16:09:31 +02:00
Philipp Jungkamp
7f514cb935 node-webrtc: initialize all members of PeerConnection
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-21 15:39:48 +02:00
Philipp Jungkamp
6985d92f6f node-amqp: Handle moved include dir of rabbitmq-c
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-21 15:36:10 +02:00
Philipp Jungkamp
87488fc167 webrtc: Change wss:// to https://
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-21 15:16:12 +02:00
Philipp Jungkamp
498b8aebdf node-webrtc: Fix logging
- Move send log before lws_write because it clobbers the buffer.
- Add raw receive log.
- Check json_dumpb return value.

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-21 15:16:12 +02:00
Steffen Vogel
c687396a28
Merge pull request #669 from VILLASframework/devcontainer-updates
Update devcontainer config
2023-06-21 12:44:12 +02:00
Steffen Vogel
c5c5c54a28 ci: Build and push VSCode devcontainer image in CI
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 12:43:45 +02:00
Steffen Vogel
bddff1aee7
Merge pull request #672 from VILLASframework/ci-release-builds
ci: Enable release builds in CI
2023-06-21 12:33:31 +02:00
Steffen Vogel
bc48e0928e ci: Enable release builds in CI
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 10:23:51 +00:00
Steffen Vogel
2bcd1d9a46
Merge pull request #666 from VILLASframework/fixes-steffen
Pending fixes from Steffen
2023-06-21 12:10:16 +02:00
Philipp Jungkamp
9d28079d24 node-redis: Work around breaking change in redis-plus-plus
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-21 11:48:04 +02:00
Steffen Vogel
398497300d cmake: update package description
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:04 +02:00
Steffen Vogel
a37b64111f fpga: call base-class function for NodeFactory::start()
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:04 +02:00
Steffen Vogel
b81e4d9b74 remove obsolete rmshm and rmsem tools
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:04 +02:00
Steffen Vogel
09c1e01f6f fix code-style
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:04 +02:00
Steffen Vogel
0aafb47dd2 redis: fix compiler warnings
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:04 +02:00
Steffen Vogel
ea1f8c3d51 iec60870: fix compiler warning
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:04 +02:00
Steffen Vogel
a709a8a0fb iec60870: fix coding style
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:04 +02:00
Steffen Vogel
88fb57df8e web: disable libwebsocket server status as it has been removed from upstream lib
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:04 +02:00
Steffen Vogel
46bc0eed7a packaging: update versions of dependencies
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:03 +02:00
Philipp Jungkamp
0473821d95 C++ code-style
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-21 11:48:03 +02:00
Steffen Vogel
260280ece0 ngsi: fix access to signal list in dead-code
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:03 +02:00
Steffen Vogel
a083488c02 packaging: do not reinstall libethercat if it is already present
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:03 +02:00
Steffen Vogel
49caafec7d cmake: fix linking if rdkafka if dependency is not installed in system search path
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:03 +02:00
Steffen Vogel
76e2986ee7 packaging: fix include search path for redispp build
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:48:03 +02:00
Steffen Vogel
60104c33ff tools: rename script to harmonize file names
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-21 11:47:56 +02:00
Steffen Vogel
a688afe379
Merge pull request #670 from VILLASframework/webrtc-signaling-fixes
Webrtc signaling fixes
2023-06-20 22:47:24 +02:00
Steffen Vogel
02abbbf99c
Merge pull request #668 from VILLASframework/webrtc-dead-code
webrtc: Remove dead code
2023-06-20 20:39:21 +02:00
Steffen Vogel
210ba00a8a webrtc: Remove dead code
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-20 17:48:24 +00:00
Steffen Vogel
7e835ceecd Update devcontainer config
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-20 17:44:22 +00:00
Steffen Vogel
2e7f8df070 webrtc: Close WebSocket connections before retrying
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-20 17:39:43 +00:00
Steffen Vogel
43bab87be6 webrtc: Support signaling messages spread over multiple WebSocket fragments
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-20 17:38:46 +00:00
Steffen Vogel
14e819568a
Merge pull request #663 from VILLASframework/fix-fpga
Fix release builds
2023-06-20 14:05:12 +02:00
Philipp Jungkamp
34fadc6bf0 packaging-nix: fix fpga node and enable it by default
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 20:18:27 +02:00
Philipp Jungkamp
c77adf6847 villas-relay: inhibit gcc warning false positive
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 19:48:38 +02:00
Philipp Jungkamp
1f9c89f559 update fpga submodule
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 19:48:25 +02:00
Steffen Vogel
13ff7a6e34
Merge pull request #662 from VILLASframework/packaging-nix
packaging-nix: improvements
2023-06-19 18:15:26 +02:00
Philipp Jungkamp
8a2aac434b packaging-nix: add separateDebugInfo to all packages
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 17:55:04 +02:00
Philipp Jungkamp
7b03598aa1 packaging-nix: remove DOWNLOAD_GO option
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 17:50:17 +02:00
Philipp Jungkamp
5eb947ad56 packaging-nix: Use correct binary path for villas-api
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 17:47:37 +02:00
Philipp Jungkamp
f1dfccd8ef fix release compile errors
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 17:47:37 +02:00
Philipp Jungkamp
7e89f8b86b packaging-nix: allow disabling GPL code from override
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 17:47:37 +02:00
Steffen Vogel
d603205b4b
Merge pull request #661 from VILLASframework/node-webrtc-docs
webrtc: Update docs
2023-06-19 16:04:02 +02:00
Steffen Vogel
b2e232a421 webrtc: Update docs
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-06-19 16:02:46 +02:00
Steffen Vogel
e18d9c0f99
Merge pull request #613 from VILLASframework/node-webrtc-cpp
Port WebRTC node-type from Golang to C++
2023-06-19 14:40:50 +02:00
Philipp Jungkamp
ebeea91bc8 node-webrtc: remove dead code and comments
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 13:56:37 +02:00
Philipp Jungkamp
d94d668d34 node-webrtc: style fixes + authorship notes
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 12:12:33 +02:00
Philipp Jungkamp
ca85117674 node-webrtc: don't inherit from std::variant
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 10:46:28 +02:00
Philipp Jungkamp
41099255f8 remove old go configuration examples
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 10:46:28 +02:00
Philipp Jungkamp
43a5292fc1 node-webrtc: fix CI warnings
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 10:46:28 +02:00
Philipp Jungkamp
bb61a59103 node-webrtc: fix signaling client memory leak and error handling
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 10:46:28 +02:00
Philipp Jungkamp
59ecd740d4 add libnice dependency to other Dockerfiles
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-19 10:46:28 +02:00
Steffen Vogel
5a78b9d69f
Merge pull request #660 from VILLASframework/villas-tools
fix villas tools installation
2023-06-17 03:05:51 +02:00
Steffen Vogel
3b016fbddd
Merge pull request #659 from VILLASframework/update-docker
update docker container images
2023-06-17 03:05:28 +02:00
Philipp Jungkamp
55998d1bcf update libdatachannel in deps.sh
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-16 16:27:54 +02:00
Philipp Jungkamp
6760272a4b node-webrtc: initial working transmission
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-16 16:27:54 +02:00
Philipp Jungkamp
6779e6d1e8 Update common submodule
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-16 16:27:54 +02:00
b2955e3e3c remove Golang node-types
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-06-16 16:27:54 +02:00
472048a0d0 do not build Doxygen docs by default anymore
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-06-16 16:27:54 +02:00
1e46b4e1e9 webrtc: add missing libnice dependency and bump libdatachannel version
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-06-16 16:27:54 +02:00
2d4783599f webrtc: signaling almost working
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-06-16 16:27:54 +02:00
40f01e904e webrtc: add new node and libdatachannel to build system
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-06-16 16:27:54 +02:00
Philipp Jungkamp
37b5b3c4fa update docker container images
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-16 16:26:40 +02:00
Philipp Jungkamp
6de8ea1147 fix villas tools installation
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-16 16:26:32 +02:00
Philipp Jungkamp
0844a9f509 fix villas tools installation
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-16 16:18:36 +02:00
Philipp Jungkamp
1baeb2738a update docker container images
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-16 15:41:47 +02:00
Steffen Vogel
9916a6b3d2
Merge pull request #656 from VILLASframework/fix-release
fix warnings in release builds
2023-06-15 11:42:04 +02:00
Philipp Jungkamp
79f39ff0e8 fix warnings in release builds
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-15 09:49:59 +02:00
Steffen Vogel
4d83b63fa2
Merge pull request #654 from VILLASframework/fix-villas-graph
fix broken reference to `boolean` in villas-graph
2023-06-14 18:14:58 +02:00
Steffen Vogel
2397c88f79
Merge pull request #657 from VILLASframework/packaging-nix
packaging-nix: use the 22.11 release of nixpkgs
2023-06-14 18:13:27 +02:00
Philipp Jungkamp
45928b02b3 packaging-nix: use the 22.11 release of nixpkgs
We don't wan't to use unstable or 23.05 to circumvent deprecation
warnings and spdlog/fmt related regressions.
More node types can now be compiled into villas-full.

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-14 17:59:08 +02:00
Philipp Jungkamp
1f96602076 fix broken reference to boolean in villas-graph
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-14 15:34:42 +02:00
Steffen Vogel
4fa688b9ce
Merge pull request #651 from VILLASframework/packaging-nix
packaging-nix: fix registry command in README
2023-06-14 10:14:47 +02:00
Philipp Jungkamp
339205f221 packaging-nix: fix registry command in README
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-14 09:26:55 +02:00
Steffen Vogel
530e189d1b
Merge pull request #646 from VILLASframework/packaging-nix
Packaging nix
2023-06-13 18:24:17 +02:00
Philipp Jungkamp
a306335079 editorconfig: add Nix formatting
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-13 18:16:55 +02:00
Philipp Jungkamp
5fce6b901c packaging-nix: update lockfile
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-13 18:16:55 +02:00
Philipp Jungkamp
08b5620188 packaging-nix: work around direnv bug
Restore the TMP, TEMP, TMPDIR, TEMPDIR variables to their previous
values if `use flake` modified them in `.envrc`.

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-13 18:16:55 +02:00
Philipp Jungkamp
7742a5f5b8 packaging-nix: disable hardening cxx flags in devShells
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-13 18:16:55 +02:00
Philipp Jungkamp
bca7f70cc2 packaging-nix: tailor libdatachannel compilation to our needs
- Use libnice for better ICE protocol support.
- Disable websockets support since we are already using libwebsockets.
- Disable media transport facilities.

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-13 18:16:55 +02:00
Philipp Jungkamp
0d69a0eefb packaging-nix: add libdatachannel for webrtc node
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-13 18:16:55 +02:00
Philipp Jungkamp
03ad3a77aa packaging-nix: improve packaging + cross-compilation
- Adds and documents some simple cross-compiling support.
- More documentation in the `flake.nix`.
- Add nixpkgs overlay (though undocumented).

Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
2023-06-13 18:16:55 +02:00
Steffen Vogel
c5606d7ac9
Merge pull request #645 from PJungkamp/packaging-nix
packaging-nix: Add `direnv` support and improve packaging
2023-06-01 20:00:53 +02:00
Philipp Jungkamp
0c9f513e8b packaging-nix: add direnv support using the nix flake
Add an `.envrc` file and add the `.direnv` directory to `.gitignore`.
`direnv` will check whether `nix` is available and `flakes` are enabled
before trying to load the environment from `packaging/nix`.

Using flakes from the `direnv` stdlib requires `direnv 2.30.0` or later.

Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-06-01 13:36:11 +02:00
Philipp Jungkamp
6a07f6f2da packaging-nix: fixes + format + format check
- format all `.nix` files using `alejandra`
- check format on `nix flake check`
- only `exec $SHELL` when bash is interactive

Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-06-01 13:34:12 +02:00
Steffen Vogel
ff863007d7
Merge pull request #644 from PJungkamp/villas-shell-quoting
tools/villas: improve script behaviour for `-h` or `--help`
2023-05-26 03:01:46 +02:00
Philipp Jungkamp
c194b621cb tools/villas: improve script behaviour for -h or --help
- Quote `${SUBTOOL}` in case it is set but empty
- Add `-e` flag to `grep` so `villas --help` does not show `grep --help`
- Add `-F` flag to `grep` so `villas "[ "` does not show a regexp error
- Don't exit with error when `-h` or `--help` was specified
- Add `-h` and `--help` to `Usage` in the help message.

Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-05-26 01:33:45 +02:00
Steffen Vogel
7506e2c289
Merge pull request #643 from PJungkamp/packaging-nix
packaging-nix: fix broken `git+file:.` input
2023-05-25 19:58:52 +02:00
Philipp Jungkamp
58dbd91616 packaging-nix: fix broken git+file:. input
The `src` input was working locally due to a bug in the `nix` flake
evaluation. The input itself was malformed and not reproducable.

Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-05-25 19:00:49 +02:00
Steffen Vogel
e47775ea29
Merge pull request #642 from PJungkamp/packaging-nix
packaging-nix: initial structure
2023-05-25 16:40:40 +02:00
Philipp Jungkamp
1fb9a89bae packaging-nix: initial structure
- add basic flake structure
- add configurable package for `villas`
- add `README` tutorial as motivation
- add package for `lib60870` and `libiec61850` not provided by `nixpkgs`

Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-05-25 16:29:13 +02:00
Steffen Vogel
14c450d501
Merge pull request #641 from VILLASframework/goose-fixes
Goose: small formatting fixes
2023-05-02 18:03:20 +02:00
Steffen Vogel
571a436c2e goose: small formatting fixes
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-05-02 16:11:41 +02:00
Steffen Vogel
302aa46d58
Merge pull request #640 from VILLASframework/node-iec61850-goose
IEC61850 Goose
2023-05-02 12:31:12 +02:00
Philipp Jungkamp
0ee9ab6be0 node-iec61850: fix undefined behaviour
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-04-18 13:52:24 +00:00
Philipp Jungkamp
fff889d779 node-iec61850-8-1: add OpenAPI schemas
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-04-18 14:06:34 +02:00
Philipp Jungkamp
9f58ec484f node-iec61850-8-1: fix ConfigError reporting
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-04-18 13:18:14 +02:00
Philipp Jungkamp
e619cb8bf1 rename node to iec61850-8-1
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-04-18 13:16:15 +02:00
Philipp Jungkamp
e612e7cebc node-iec61850-goose: change resend_interval to double seconds
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-04-11 15:04:41 +02:00
Philipp Jungkamp
5a1995d901 node-iec61850-goose: Periodic resend and cleanup
- introduce resend_thread for periodic resend
- change mms_type to reflect the table in iec61850.hpp to be able to
  merge these tables in the future without breaking configs

Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-03-28 13:22:16 +00:00
Niklas Eiling
83c0e2b185 Merge pull request #81 from VILLASframework/dma-ingress
adds C bindings and other smaller changes
2023-03-21 17:57:47 +01:00
Niklas Eiling
d9993409e0 fix possible NULL dereferencing in villasfpga_dma.c
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-21 14:56:54 +01:00
Niklas Eiling
1d9ccd6c05 add license note to villasfpga_dma.c
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-21 11:59:22 +01:00
Niklas Eiling
9d4cd5384d clean up debuggin output and fix scanf usage in villasfpga_dma.c
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-21 11:52:36 +01:00
Niklas Eiling
d273162f71 fix PCIeCardFactory looking for IP config file at the wrong location
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-21 11:29:32 +01:00
Niklas Eiling
d9e60e22b1 make it possible to specify a search path in PcieCard::make so we can use relative paths in config files
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-21 11:15:25 +01:00
Niklas Eiling
c05ae4d282 add C bindings for DMA interactions and add a test/example
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-21 10:47:45 +01:00
Niklas Eiling
b05910f24e add C bindings for external use of VILLASfpga
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-20 17:12:47 +01:00
Niklas Eiling
7847658548 fix output formatting not being able to print numbers larger than 9
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-20 15:35:38 +01:00
Niklas Eiling
e6f34f83f4 make villas-fpga-pipe use separat memory segments for reading and writing
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-20 12:10:37 +01:00
Niklas Eiling
4ef114fad4 remove unnecessary characters in villas-fpga-ctrl
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-20 10:23:13 +01:00
Niklas Eiling
6b58624e57 fix villas-fpga-pipe
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-15 16:11:44 +01:00
Niklas Eiling
cbad1ca9d1 ConnectString: also allow pipe as a connection target
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-03-15 16:11:44 +01:00
Philipp Jungkamp
98ac02a85b node-iec61850-goose: log error instead of crashing on unsupported mms value
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-03-14 16:46:35 +01:00
Philipp Jungkamp
9dcef61c99 node-iec61850-goose: GooseSignal refactor + fixes
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-03-14 15:34:30 +00:00
Philipp Jungkamp
89813a8cc7 iec61850-goose: multiple producers
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-03-07 12:56:03 +00:00
Niklas Eiling
dbd496c2c6 Merge pull request #80 from VILLASframework/refactorCard
Remove duplicate inherited members and functions in PcieCard class
2023-02-10 14:19:59 +01:00
Pascal Henry Bauer
3db2005bbf removed duplicated declarations
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-02-10 13:34:20 +01:00
Pascal Henry Bauer
26e2251afe reorder of members and added virtual
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-02-10 13:34:20 +01:00
Pascal Henry Bauer
85b2e8b030 removed duplicate implementation
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-02-10 13:34:20 +01:00
Philipp Jungkamp
2d643b8f47 initial example for iec61850-goose node
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-01-31 11:27:48 +00:00
Philipp Jungkamp
75ebfbc623 initial iec61850-goose node
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-01-31 11:12:51 +00:00
Philipp Jungkamp
cba7894da0 Update libiec61850 from 1.4 to 1.5
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
2023-01-31 11:12:49 +00:00
Niklas Eiling
8fbf0f0669 Merge pull request #76 from VILLASframework/dma-ingress
Device to Host DMA
2023-01-30 16:30:33 +01:00
Niklas Eiling
c80e5c083d remove map and umapmemoryblock from PcieCard
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:26:11 +01:00
Niklas Eiling
10ecf6c9a6 fix memoryBlocksMapped being defined in both Card and PcieCard
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:18:42 +01:00
Niklas Eiling
87968ab73e enable reading from stdin to DMA in villas-fpga-ctrl
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:12:16 +01:00
Niklas Eiling
1e3294d14c start readFromDmaToStdOut in separate thread
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:12:16 +01:00
Niklas Eiling
62cab0c4dc clean up README.md
add project description and related projects (MIOB and DINO)

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:12:16 +01:00
Niklas Eiling
e6f035cd31 add basic thread-safety to ips/dma
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:12:16 +01:00
Niklas Eiling
590cef10d0 add check for missed interrupts when handling reads
introduce new struct Completion that is returned by Dma::readCompletion
and Dma::writeCompletion

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:12:16 +01:00
Niklas Eiling
ab39f57405 add more configuration options to villas-fpga-ctrl
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:12:15 +01:00
Niklas Eiling
8ff0370d36 fix license of utils.hpp
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:12:15 +01:00
Niklas Eiling
ce1e8e28ce move formatting of printing to stdout to separate class and make in configurable
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:12:15 +01:00
Niklas Eiling
498af9fd1c ips/dma: make read correctly wait on interrupts
Modify villas-fpga-ctrl to fit the new behavior of Dma.
Makes reading from DMA work even when we are too slow and
only receive partial batches of BDs.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:12:15 +01:00
Niklas Eiling
5ab6007909 small code review
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:12:10 +01:00
Niklas Eiling
14f924b6c5 rework MemoryBlock use to make use of shared_ptr so the lifetime of the objects is properly tracked
this fixes that the wrong order of allocating and PciCard destruction
causes an undefined state.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:09:09 +01:00
Niklas Eiling
40d0452b0a move connectString parsing into separate class
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:02:32 +01:00
Niklas Eiling
b66733640a format and comment fixes
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:02:32 +01:00
Niklas Eiling
418a8dc7a9 fix segfault in card because vfioContainer was shadowed in PcieCard
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-30 16:02:13 +01:00
Niklas Eiling
02ce5b15dc Merge pull request #78 from VILLASframework/refactorPcieClass
Refactor pcie class
2023-01-30 11:34:14 +01:00
Pascal Henry Bauer
f81a1ddc6d moved destructor to base class
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-27 16:57:31 +01:00
Pascal Henry Bauer
2a9db48888 fixed wrong name in comment
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-27 15:53:05 +01:00
Pascal Henry Bauer
7f2ed2180d fixed formatting
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-27 14:04:22 +01:00
Pascal Henry Bauer
6de526c894 fixed formatting
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-27 13:59:45 +01:00
Pascal Henry Bauer
3587ccc0fa change pciecard name to pcie_card
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 18:30:14 +01:00
Pascal Henry Bauer
9be5c3c274 removed duplicate inherited members
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 18:30:14 +01:00
Pascal Henry Bauer
6b87c9bc30 refactor to use pcie card (Legacy)
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 18:30:14 +01:00
Pascal Henry Bauer
e8b593cf1f added card definitions
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 18:30:14 +01:00
Pascal Henry Bauer
0dd52db44d add card header declarations
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 18:30:14 +01:00
Pascal Henry Bauer
22244fed04 add include guard
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 18:30:14 +01:00
Pascal Henry Bauer
dfb4d30b3f added namespace
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 18:30:14 +01:00
Pascal Henry Bauer
7534086e08 change core to use base class card over pcieclass
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 18:30:14 +01:00
Pascal Henry Bauer
ae944b6ce3 added copyright information
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 18:30:14 +01:00
Pascal Henry Bauer
a10e568777 added pcieclass to buildsystem
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 18:30:14 +01:00
Pascal Henry Bauer
d2d7f9430d moved pciecard to own file
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 18:30:14 +01:00
Pascal Henry Bauer
e254e7cfe6 move card class to own file
Signed-off-by: Pascal Henry Bauer <pascal.bauer@rwth-aachen.de>
2023-01-26 17:08:19 +01:00
Steffen Vogel
37c9efad92
Merge pull request #638 from VILLASframework/ci-reenable-fpga
Re-enable VILLASfpga node-type in CI
2023-01-17 13:45:40 +01:00
Steffen Vogel
6eb20df258 re-enable VILLASfpga node-type in CI
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-01-17 13:34:47 +01:00
Steffen Vogel
c976cd62d8
Merge pull request #637 from VILLASframework/fix-node-fpga
fix broken VILLASfpga node-type
2023-01-13 11:37:54 +01:00
Steffen Vogel
f6789e4739 fix broken VILLASfpga node-type
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-01-13 11:28:53 +01:00
Steffen Vogel
0a8eebe41f
Merge pull request #635 from VILLASframework/update-fedora
Update Fedora version 36
2023-01-11 17:00:58 +01:00
Steffen Vogel
308fa431fd add missing package for iproute2 TC
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-01-11 12:58:53 +01:00
Steffen Vogel
8464975447 ci: remove libsegfault usage as its gone in newer glibc versions
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-01-11 12:58:53 +01:00
Steffen Vogel
59bd1dea56 update Fedora version 36
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-01-11 12:58:53 +01:00
Steffen Vogel
3d052cdf6f
Merge pull request #633 from VILLASframework/libfmt9
Make compatible to fmt version 9.0.3
2023-01-11 12:54:45 +01:00
Steffen Vogel
be1c68efc5 remove superfluous parantheses
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-01-11 12:40:47 +01:00
Steffen Vogel
cdd8ad93e5 remove obsolete forward declaration
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-01-11 12:39:49 +01:00
Steffen Vogel
e19d190b5a
Merge pull request #636 from VILLASframework/update-fpga-submodule
Update VILLASfpga submodule
2023-01-11 12:37:08 +01:00
Manuel Pitz
48b98c195c make compatible to fmt version 9.0.3 review fixes
Signed-off-by: Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
2023-01-11 12:11:57 +01:00
Manuel Pitz
cf04f6b569 make compatible to fmt version 9.0.3 review fixes
Signed-off-by: Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
2023-01-11 12:11:57 +01:00
Manuel Pitz
c4bce72c04 make compatible to fmt version 9.0.3
Signed-off-by: Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
2023-01-11 12:11:57 +01:00
Manuel Pitz
1a01012e7c make compatible to fmt version 9.0.3
Signed-off-by: Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
2023-01-11 12:11:57 +01:00
Steffen Vogel
221cac131a update VILLASfpga submodule
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-01-11 10:02:54 +01:00
Steffen Vogel
cf7f190b22 Merge pull request #77 from VILLASframework/update-libxil-submodule
Update libxil submodule
2023-01-11 09:59:36 +01:00
Steffen Vogel
62af43f25e update libxil submodule
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-01-11 09:40:23 +01:00
c5d1ef20ed Merge pull request #66 from VILLASframework/relicense
Relicense project to Apache-2.0 license
2023-01-09 11:38:09 +01:00
8741f39029 fix cppcheck error
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-09 11:35:44 +01:00
ea5ab4ed5d fix broken CMakeLists
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-09 11:21:05 +01:00
94cf3583d8 fix naming of fpgaHelper file
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-09 08:11:35 +01:00
8376508b6e fix copyright notices in license files
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-09 08:10:12 +01:00
63f3463b54 fix attribution to Daniel
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-09 08:08:40 +01:00
1c6779287b remove old Doxygen comments
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-07 17:33:54 +01:00
9b27c31b9c fixup copyright texts
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-07 17:32:48 +01:00
8a71542d4f run reuse linter in CI
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-07 17:24:05 +01:00
f776cba693 relicense project to Apache 2.0
The project is now also REUSE compliant: https://reuse.software/
Previous copyright holders have provided their
acknowledgement to transition to the new license in the
following GitHub PR: https://github.com/VILLASframework/fpga/pull/66

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-07 17:20:15 +01:00
Niklas Eiling
8abd9901b1 Merge pull request #62 from VILLASframework/new-plugin
New plugin registration mechanism
2023-01-05 14:23:57 +01:00
eff0f2e83f fix RTDS IP unit test
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-05 14:21:20 +01:00
c678fe36fc update libxil submodule
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-05 14:21:20 +01:00
d2434cd8d5 code-style fixes
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-05 14:21:20 +01:00
4593f6c42f dma: use virtual destructor
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-05 14:21:20 +01:00
53ddbe4e10 refactor registration of IP core drivers to be aligned with registration of VILLASnode formats and node-types
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2023-01-05 14:21:20 +01:00
Niklas Eiling
54c2c4633f Merge pull request #75 from VILLASframework/fix/vfio-crashes
Fix/vfio crashes
2023-01-05 14:16:28 +01:00
Niklas Eiling
c6a2629dff remove redundant and wrong comment
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-05 14:03:36 +01:00
Niklas Eiling
4785146a4c fix villas-fpga-cat and villas-fpga-xbar-select scripts to use villas-fpga-ctrl
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-05 12:30:36 +01:00
Niklas Eiling
80af655ac5 make DMA ip unmap memory owned by itself
unmapping of the scatter gather attribute memory was done
after the DMA destructor was called, leading to Card trying to
unmap memory that was already freed.
This lead to crashing during cleaning up.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-04 17:17:21 +01:00
Niklas Eiling
d818ecd365 node.hpp: remove unused struct
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-04 17:17:08 +01:00
Niklas Eiling
a818bc0b64 combine functionalities of binaries into a single one
combine what was previously achieved by the separate binaries
villas-fpga-xbar-select and villas-fpga-cat into a single new
binary villas-fpga-ctl. Here we can select crossbar connections
via command line parameters. To avoid regression there are shell
scripts providing the old functionalities directly.

Currently the villas-fpga-pipe functionality is not supported,
because we still need to implement stdin input and routing that
to the fpga.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-04 17:16:35 +01:00
Niklas Eiling
f5b0762b1a make memory manager destroy IP objects and improve DMA logging
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2023-01-04 11:04:48 +01:00
Niklas Eiling
47379f0374 Merge pull request #73 from VILLASframework/cppcheck
fix cppcheck CI
2022-12-19 15:59:23 +01:00
Pascal Bauer
3fc982bcef update common submodule
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:36 +01:00
Pascal Bauer
56dcf9fac6 add comment to suppress casting warning
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:36 +01:00
Pascal Bauer
1c85a4330f cast voidpointer to uint for arithmetik
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:36 +01:00
Pascal Bauer
ef7bb1697d suppress "unmatchedSuppression"
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:36 +01:00
Pascal Bauer
082dd40edb added class name before virtual method
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:36 +01:00
Pascal Bauer
2c7e9151e6 removed duplicate member already present in parent class
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:36 +01:00
Pascal Bauer
f84651c1ae removed unnecessary virtual
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:36 +01:00
Pascal Bauer
3840fa1fa6 removed unnecessary closing bracket
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:36 +01:00
Pascal Bauer
0644f1310d removed empty brackets
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:36 +01:00
Pascal Bauer
c77d124682 fixed allocation order
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:36 +01:00
Pascal Bauer
327f343924 changed parameters to const refs
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:35 +01:00
Pascal Bauer
00fa5094f9 pass constructor parameter as const ref for performance
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:35 +01:00
Pascal Bauer
a2b8b2942e fixed memory leak (missing deletes before return)
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:35 +01:00
Pascal Bauer
6a8acc467b changed casting from intmax to uintmax
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:35 +01:00
Pascal Bauer
65a9a85456 fixed pipe before parameter
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:35 +01:00
Pascal Bauer
4808092e3a exclude thirdparty gpu
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
2022-12-19 15:47:35 +01:00
Niklas Eiling
18e07c604c Merge pull request #72 from VILLASframework/update-mail
Update Steffens mail address
2022-12-16 16:43:57 +01:00
dee5b2d81f update Steffens mail address
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-14 17:44:17 +01:00
d855198de7 Merge pull request #71 from VILLASframework/no-ptr-alias
Remove aliases for smart pointers and lists
2022-12-09 10:38:01 +01:00
92ab5d078f remove aliases for smart pointers and lists
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-07 19:04:47 +01:00
a81f380bbd Merge pull request #69 from VILLASframework/fix-build-badge
ci: fix build badge
2022-12-07 10:58:22 +01:00
085aab567d ci: fix build badge
Signed-off-by: Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
2022-12-07 10:58:12 +01:00
Niklas Eiling
983fc82d35 Merge pull request #67 from VILLASframework/dco-steffen
Sign-off past commits of Steffen Vogel
2022-12-07 10:25:11 +01:00
2ce8a1a32b Merge pull request #68 from VILLASframework/fix-submodules
Update URLs of submodules
2022-12-06 20:46:11 +01:00
d2cfaac5f3 update URLs of submodule
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-06 20:45:25 +01:00
b7c3d618d6 sign-off past commits of Steffen Vogel
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-06 17:45:09 +01:00
6119fd71e5 Merge pull request #65 from VILLASframework/sign-off-niklas-eiling
sign-off past commits of Niklas Eiling
2022-12-06 11:36:18 +01:00
Niklas Eiling
89a1cd424e sign-off past commits of Niklas Eiling
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2022-12-06 10:55:32 +01:00
Niklas Eiling
03f8d0782e Revert "core: move configuration of polling mode to parse()"
The changes lead to crashing because intc will not be configured
properly. Also revert removing configDone in ips/dma

This reverts commit 3b8949afe9.

Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2022-12-05 10:36:45 +01:00
c77a0d510a card: allow configuration of AXI-Stream switch paths
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-05 09:36:47 +01:00
4fb804ac44 ips: fix declarations of virtual member functions
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-05 09:36:42 +01:00
c2437b51cf smaller code-style fixes
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-05 09:35:33 +01:00
3b8949afe9 core: move configuration of polling mode to parse()
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-05 09:35:32 +01:00
09af6d9e88 refactor Core::configure() to Core::parse()
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-05 09:35:32 +01:00
0959809573 code style fixes
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-05 09:35:32 +01:00
14c7e57a8a fix parsing of IP parameters
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-05 09:35:32 +01:00
75bfb6ff34 fix Markdown rendering of copyright section
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-12-05 09:35:32 +01:00
Niklas Eiling
1fecb66fb3 bump common subrepo and use shared pointers for vfio::Container
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2022-12-05 09:31:37 +01:00
Niklas Eiling
404bc9c8be fix throwing an error in villas-fpga-cat leading to abort, because of wrong deconstructor order
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2022-12-03 15:16:24 +01:00
Niklas Eiling
f26656a90d bump common subrepo, use debug logging in villas-fpga-cat
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2022-12-02 13:52:32 +01:00
Niklas Eiling
74ad0783f6 bump common subrepo and use new interface
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2022-12-02 13:52:32 +01:00
Niklas Eiling
905d28d1e4 ips/dma: use destructor to reset DMA controller
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
2022-12-02 13:52:31 +01:00
Niklas Eiling
fd3c51ccc0 update contact and copyright notice 2022-11-29 14:51:54 +01:00
Niklas Eiling
0d0aae090d add villas-fpga-xbar-select; improve DMA parameters in ips/dma 2022-11-29 14:51:54 +01:00
Niklas Eiling
6a900ba5e4 fix villas-fpga-cat interpreting floats wrong 2022-11-29 14:51:54 +01:00
Niklas Eiling
f105b08144 clean up and comment ips/dma.cpp 2022-11-29 14:51:53 +01:00
Niklas Eiling
34c8458500 villas-fpga-cat: fix double value being constructed wrong 2022-11-29 14:51:53 +01:00
Niklas Eiling
0c6c30dda3 ips/dma: comment debug outputs to improve villas-fpga-cat performance
fix rebase artifacts
2022-11-29 14:51:53 +01:00
Niklas Eiling
fb48e36a0b add villas-fpga-cat app that outputs a stream of data 2022-11-29 14:51:53 +01:00
Niklas Eiling
e029963839 move helper functions from villas-fpga-pipe into separate file 2022-11-29 14:51:53 +01:00
Niklas Eiling
3f69ce6693 Merge branch 'fix-gitlabyml' into 'master'
fix image reference in gitlab.yml

See merge request acs/public/villas/fpga/fpga!21
2022-11-17 16:03:23 +01:00
Niklas Eiling
2ffd15989f fix image reference in gitlab.yml 2022-11-17 15:49:10 +01:00
57fbcb836e Merge branch 'fix-dockerfile' into 'master'
migrate dockerfile to rocky9

See merge request acs/public/villas/fpga/fpga!20
2022-11-17 14:47:24 +01:00
Niklas Eiling
791ece434b migrate dockerfile to rocky9 2022-11-17 14:40:10 +01:00
ba16653820 minor code-style fixes 2022-11-11 05:03:43 -05:00
Niklas Eiling
e4a469f99f ips/dma: fix hasScatterGather using wrong member variable; Throw error used on unconfigured Dma 2022-11-11 04:53:58 -05:00
Niklas Eiling
49db359851 ips: fix some formatting issues 2022-11-11 04:53:58 -05:00
Niklas Eiling
dfb2a967d8 ips/dma: use NodeFactory's configureJson to setup memory graph 2022-11-11 04:53:58 -05:00
Niklas Eiling
7b4176a710 ips/dma: use json_unpack 2022-11-11 04:53:58 -05:00
Niklas Eiling
bac0b7309a add card config option "polling" to configure polling mode in IP cores; add json parsing of hwdef to dma IP core to replace hardcoded DMA settings. 2022-11-11 04:53:58 -05:00
Niklas Eiling
7b2f0f3d96 ip/dma: fix spelling 2022-11-11 04:53:58 -05:00
Niklas Eiling
5acf4f96e9 ips/dma: acknowledge interrupts in DMA controller and correctly set coalescing parameter. 2022-11-11 04:53:58 -05:00
Niklas Eiling
da483d8d3a make dma.cpp use interrupts instead of polling 2022-11-11 04:53:58 -05:00
5060f07067 move VILLASnode configs to VILLASnode repo 2022-11-11 03:16:04 -05:00
e82234c93e update VILLAScommon submodule 2022-11-11 03:13:29 -05:00
5fc556523c add libxil as a submodule 2022-11-11 03:12:53 -05:00
228d929840 updated VILLAScommon submodule 2022-10-28 11:42:12 -04:00
2a068ec3a6 core: avoid reversing initialization order list 2022-10-28 11:32:18 -04:00
3f8a38adce dma: first successful test with scatter gather
(Aurora IPs still broken?)
2022-10-28 11:32:01 -04:00
dbf25a6d8e adapt villas-fpga-pipe to new DMA code 2022-10-28 08:19:00 -04:00
7be3b049c7 update IPs config for new bitstream using MSI IRQs 2022-10-28 08:18:47 -04:00
0dfffb94c4 dma: added second version of scatter-gather support 2022-10-28 08:18:24 -04:00
2f7107753a update gitignore 2022-10-28 08:17:58 -04:00
ab3cb2303b minor code style and comment fixes 2022-10-28 08:17:26 -04:00
7e0848b7d5 dma: throw exception in makeAccesibleFromVA instead of returning bool 2022-10-28 08:16:58 -04:00
ab994f2c87 fix script to reset PCIe card 2022-10-28 08:08:30 -04:00
add8dad95b remove useless includes 2022-10-28 08:06:57 -04:00
894460cd7b intc: fix VLNV for Niklas' new bistream 2022-10-28 08:05:48 -04:00
2d21432a5f aurora: fix names of AXI-S interfaces 2022-10-28 08:05:30 -04:00
0e0197a3be fix coding style 2022-10-28 08:03:57 -04:00
7ccb23d8b4 remove old C code 2022-10-28 02:18:21 -04:00
72cfade589 dma: start implementing scatter-gather support 2022-10-27 06:02:45 -04:00
26231dc78c add example config for VILLASnode integration 2022-10-27 06:02:20 -04:00
2ad5fc1ccf remove broken symlink 2022-10-27 06:01:55 -04:00
80abbb866b add latest vc707 config 2022-10-27 06:01:42 -04:00
b37388a143 remove last pieces of hardware submodule 2022-10-13 03:38:39 -04:00
7ceffa642b bump libxil version requirement 2022-09-13 03:31:38 -04:00
60df06113e villas-fpga-pipe: whitespaces and syntax fixes 2022-09-13 03:25:48 -04:00
0a93da7bad adjust DMA IP core to new DMA parameters of Niklas' bitstream 2022-09-13 03:25:17 -04:00
161a9e349f update VILLAScommon submodule 2022-08-30 12:22:40 -04:00
d6c7e69866 add missing parentheses 2022-08-30 12:22:40 -04:00
9ef01d068e update year in copyright notices 2022-08-30 12:22:40 -04:00
c7180e729a fixes for villas-fpga-pipe 2022-08-30 12:22:36 -04:00
fb824a82f9 cleanup of comments 2022-08-30 12:21:46 -04:00
5c68a22ffe add new IP core for standard Xilinx Aurora cores 2022-08-30 12:21:46 -04:00
8a6832edc3 card: allow loading IPs devicetree from extra file 2022-08-30 12:21:46 -04:00
0597e975a0 update gitignore 2022-08-30 12:21:46 -04:00
a433ba5d44 add VSCode configuration for GDB debugging as root 2022-08-30 12:21:46 -04:00
f2a1c78f96 harmonize logger names 2022-08-30 12:21:45 -04:00
bcec3efd5f update code to latest common submodule 2022-08-30 12:21:45 -04:00
28262ef79b remove old configs 2022-08-30 12:21:45 -04:00
b202f11d05 update hardware submodule 2022-08-30 12:21:45 -04:00
7e3a58ce2e update gitignore 2022-08-30 16:36:01 +02:00
8beac4a394 fix CI 2022-03-04 03:46:47 -05:00
c90b1c1f3e fix format strings 2022-03-04 03:33:47 -05:00
8a99307ba2 update config include 2022-03-04 03:33:27 -05:00
49572d0a74 adapt to new plugin registry 2022-03-04 03:33:07 -05:00
53c4c4bf77 remove obsolete htdocs setting 2022-03-04 03:30:42 -05:00
8d6e9eda5d remove hardware submodule 2021-07-07 12:31:33 +02:00
f59a763cd1 Merge branch 'fix-cmake' into 'master'
cmake: allow linking libxil from non-standard location

See merge request acs/public/villas/fpga/fpga!15
2020-11-12 00:45:06 +01:00
2bbe5bc0ab cmake: allow linking libxil from non-standard location 2020-11-12 00:19:55 +01:00
0dcfe416b3 Merge branch 'cppcheck' into 'master'
Add cppcheck to CI pipeline

See merge request acs/public/villas/fpga/fpga!14
2020-09-21 10:00:20 +02:00
a04c1d7abf ci: add cppcheck 2020-09-21 09:37:10 +02:00
5502d3577b remove unused submodules 2020-08-17 17:21:18 +02:00
f550ec5359 Merge branch 'fix-codestyle' into 'master'
fix code-style

See merge request acs/public/villas/fpga/fpga!12
2020-07-27 17:09:57 +02:00
8ec16094f2 fix code-style 2020-07-27 16:48:53 +02:00
e5545aa17e emc: add initial code to flash FPGA bitstream via PCIe 2020-07-08 17:16:43 +02:00
eabae63714 update submodules 2020-07-08 15:24:01 +02:00
08114652d6 emc: add stub IP 2020-07-08 15:20:05 +02:00
10b8878279 fix naming of factories 2020-07-08 15:10:26 +02:00
8bb033f89d update hardware submodule and move hwdef-parse script into hardware repo 2020-07-08 14:14:38 +02:00
Hatim Kanchwala
8a4e95d75c Use sensible colour scheme for error status output 2020-07-04 15:11:01 +02:00
Hatim Kanchwala
89f75c9a57 Remove old JSON config files 2020-07-04 15:11:00 +02:00
c4fe7e4b07 update libxil submodule 2020-06-15 22:49:43 +02:00
ba9d670d4b cmake: make unit-tests optional 2020-06-15 22:49:19 +02:00
e3cfc26673 Merge branch 'refactoring' into 'master'
Refactoring

See merge request acs/public/villas/fpga/fpga!11
2020-06-15 22:12:35 +02:00
7e2365bfa0 ci: update CI config 2020-06-15 22:09:18 +02:00
031311ba95 docker: add missing deps 2020-06-15 21:45:50 +02:00
a935a5856a docker: add mising ssl headers 2020-06-15 21:29:46 +02:00
2700493f2f docker: fix location of FEIN e.V. repo 2020-06-15 21:25:55 +02:00
c5e3d3dd4a node: add connect() with reverse path 2020-06-15 21:21:16 +02:00
6c225c8fae update VILLAScommon submodule 2020-06-15 21:21:05 +02:00
74f55fa98c refactor: more code-style improvements 2020-06-15 21:08:49 +02:00
cc456b6525 refactor: no namespace scopes in source files 2020-06-14 22:12:41 +02:00
d938bd95b1 cmake: fixups for inclusion into VILLASnode 2020-06-14 22:11:58 +02:00
a9f9dc4a37 refactor: no namespace scoeps in source files 2020-06-14 22:11:26 +02:00
8b7bbe27c6 refactor: whitespaces for references 2020-06-14 22:03:50 +02:00
e86a291dfd update VILLAScommon submodule 2020-06-12 00:08:04 +02:00
6b3164dd26 refactor IpNode and IpCore class names 2020-06-12 00:05:03 +02:00
7c92a30ab4 several cleanups and bugfixes 2020-06-11 23:55:05 +02:00
bb8a711f02 use new getter for graph 2020-06-11 23:40:12 +02:00
1af96b20e4 pipe: use correct DMA instance 2020-06-11 19:02:49 +02:00
b7e5bfead2 harmonize codestyle 2020-06-11 18:38:46 +02:00
3f1ab8e862 use new vlnv id for aurora_axis 2020-06-11 18:19:28 +02:00
77b55f65f7 use new plugin mechanism 2020-06-11 18:19:03 +02:00
91f9000038 unit-tests: allow FPGA configuration to provided via env var 2020-06-11 16:09:58 +02:00
cc1d1d4298 plugin: fix lookup 2020-06-11 16:01:42 +02:00
86f8997b05 gpio: add new IP for AXI programmable GPIO 2020-06-11 15:58:02 +02:00
d5b1012b75 intc: fix name of register space 2020-06-11 15:57:05 +02:00
6882e9d418 harmonize code-style with VILLAScommon/node 2020-06-11 14:26:38 +02:00
c906116d86 update to latest VILLAScommon submodule 2020-06-11 14:20:33 +02:00
3b28eea7d2 aurora_axis: add two functions to reset counters and configure loopback mode 2020-06-11 13:08:42 +02:00
1596208bb6 aurora_axis: dump frame counters 2020-06-11 13:01:44 +02:00
3d15323376 aurora_axis: harmonize with HDL changes 2020-06-11 13:01:27 +02:00
bab9e22fdb update submodule urls 2020-06-11 12:37:53 +02:00
Hatim Kanchwala
448068082f Improve comments for status/control register bits 2020-06-08 00:55:33 +02:00
Hatim Kanchwala
0a7c6cc31c Define register addresses and bits 2020-06-05 23:41:08 +02:00
Hatim Kanchwala
4005a0b40e Merge branch 'master' of git.rwth-aachen.de:acs/public/villas/VILLASfpga 2020-06-02 00:54:54 +02:00
Hatim Kanchwala
bf67a2e5f0 Add initial Aurora driver 2020-06-02 00:54:31 +02:00
02f60eb86e add a writeMemory function to IpCore class 2020-05-26 15:24:15 +02:00
Hatim Kanchwala
73e85f2e5a Add intial header file for Aurora 2020-05-26 14:46:35 +02:00
dd1a17c4a5 update bitstream configs 2019-08-15 13:57:29 +02:00
44d63cd4b0 update common submodule 2019-08-15 13:57:17 +02:00
30dff972f2 several fixes for villas-fpga-pipe 2019-08-15 13:55:39 +02:00
f6a78bea69 dma: add dump() method 2019-08-15 13:54:58 +02:00
Hatim Kanchwala
bf74db8e79 Debug update 2019-06-24 12:11:44 -04:00
3326c83fc7 add note to cite our publication 2018-09-20 11:19:23 +02:00
5361c1d20d move gpu module to top level directory 2018-08-21 15:53:47 +02:00
3f119896e9 ci: some tweaks to fix unit-tests 2018-08-21 15:29:37 +02:00
d191a86c18 do not call copy-ctor of villas::HostRamAllocator 2018-08-21 14:25:42 +02:00
8b45a8bcac fix include paths 2018-08-21 14:25:20 +02:00
ea4b453250 tests: remove obsolete unit tests which have been moved to VILLAScommon 2018-08-21 13:54:21 +02:00
2112038d70 Merge branch 'feature/hls-rtds2gpu' into develop 2018-08-21 13:51:32 +02:00
5c7f167617 pipe: rename streamer to pipe (closes #19) 2018-08-21 13:40:38 +02:00
106d215dd2 fix gdrcopy submodule 2018-08-21 13:31:56 +02:00
4158ddb792 gpu: fix include paths and some linker settings 2018-08-21 13:28:07 +02:00
76b1695586 move more code to VILLAScommon repo 2018-08-21 13:27:04 +02:00
Daniel Krebs
96cd71a87e gpu/gdrcopy: rebase on current upstream master and update 2018-08-21 13:12:51 +02:00
5e8c602c8d ci: use Centos 7 based Docker Image with CUDA dev env from Nvidia 2018-08-21 12:39:39 +02:00
d0ff063e70 ci: use relative path in gitmodules for proper access rights 2018-08-21 12:24:50 +02:00
9b0c0226c3 update common submodule 2018-08-21 12:22:51 +02:00
f8de9425fe streamer: use new memory api 2018-08-21 11:10:09 +02:00
df89b63368 fix include paths 2018-08-21 11:07:53 +02:00
de566d441d move common code to VILLAScommon submodule 2018-08-21 01:14:18 +02:00
Daniel Krebs
b2698c8bd5 rtds2gpu: update register type to work for more complex payloads 2018-07-26 16:49:06 +02:00
Daniel Krebs
c44aedd6a9 gpu: update to recent GDRcopy 2018-07-20 16:52:09 +02:00
Daniel Krebs
26abf44d2f villas/memory: add sanity check to deny allocating zero-sized memory 2018-07-20 16:50:54 +02:00
Daniel Krebs
8a06e96e92 gpu: always allocate page-sized chunks, then use LinearAllocator
This was neccessary in order to make the memory available via GDRcopy
when multiple small allocations were made. cudaMalloc() would return
multiple memory chunks located in the same GPU page, which GDRcopy
pretty much dislikes (`gdrdrv:offset != 0 is not supported`).
As a side effect, this will keep the number of BAR-mappings done
via GDRcopy low, because they seem to be quite limited.
2018-07-20 16:46:55 +02:00
Daniel Krebs
375b6b5cd3 common/memory: let allocators own a memory block
This is useful when we sub-delegate management of a memory block
to another allocator.
2018-07-20 16:44:50 +02:00
Daniel Krebs
0cdc05c3d5 rtds2gpu: add struct for memory layout of rtds2gpu buffer 2018-07-11 16:06:48 +02:00
Daniel Krebs
98c98b6855 tests: add missing gpu kernels 2018-07-11 14:00:20 +02:00
63a1eb2f7f remove some obsolete C code files 2018-06-25 17:22:31 +02:00
7409d2024d add more copyright / license headers 2018-06-25 17:03:09 +02:00
acd9412f6e add Daniel to README 2018-06-25 16:43:15 +02:00
9d57983934 added submodule to VILLASfpga-hardware repo 2018-06-25 16:38:48 +02:00
55c9131958 update Fedora version in Dockerfile 2018-06-25 16:01:54 +02:00
fb6a7178b7 add pcimem.c 2018-06-25 16:01:38 +02:00
7fd6599ea6 update copyright years 2018-06-25 15:33:14 +02:00
63e523de46 do not store bitstreams here 2018-06-25 15:27:06 +02:00
Daniel Krebs
d853d5e0d3 wip GPU RTT 2018-06-06 09:55:14 +02:00
Daniel Krebs
f7781d47af tests/rtds2gpu: cleanup 2018-06-05 14:56:43 +02:00
Daniel Krebs
2a56f5ff13 tests/rtds2gpu: fix doorbell offset 2018-06-05 14:48:35 +02:00
Daniel Krebs
49f0c2e0c4 unit test RTT via CPU to/from RTDS works! 2018-06-04 19:06:36 +02:00
Daniel Krebs
92bfe849b4 ips/rtds2gpu: use new connect interface 2018-06-04 17:36:36 +02:00
Daniel Krebs
194c4e3eef etc: update fpga.json with changes related to stream routing 2018-06-04 17:36:36 +02:00
Daniel Krebs
f413712b86 gpu2rtds: unit test working 2018-06-04 17:36:36 +02:00
Daniel Krebs
93fe1390d6 fix wrong usage of reinterpret_cast in ips and tests 2018-06-04 17:36:36 +02:00
Daniel Krebs
010e0c3681 hls: add base HLS IP and enable virtual multi-inheritance
Virtual inheritance is required because (for example) the Rtds2Gpu
IP inherits from Hls and IpNode who both inherit from IpCore.
2018-06-04 17:36:36 +02:00
Daniel Krebs
5c67dc3727 rtds2gpu: update vlnv to match v1.1 and adapt config to new bitstream 2018-06-04 17:36:15 +02:00
Daniel Krebs
28458fdf8a update rtds2gpu HLS IP to v1.1
- better tested IP (testbenches)
 - detect invalid frame sizes
 - more status reporting
2018-06-04 17:36:15 +02:00
Daniel Krebs
bf286568dd rtds2gpu IP works 2018-06-04 17:36:15 +02:00
Daniel Krebs
b03b94d754 ip-node: fix wrong cast and add more sanity checks 2018-06-04 17:31:25 +02:00
Daniel Krebs
47bd186f5e ip-node: move stream graph to IpNode and add easy-to-use connect interface 2018-06-04 17:31:12 +02:00
Daniel Krebs
00fb0363dd ips/switch: add more sanity checks for making connections 2018-06-04 17:30:11 +02:00
Daniel Krebs
e9add5d602 ips/dma: enable interrupts by default 2018-06-04 14:20:06 +02:00
Daniel Krebs
d19619fe1f tests: cleanup CMakeLists.txt 2018-06-04 14:20:06 +02:00
Daniel Krebs
31c854f26f src: add streamer application for RTDS 2018-06-04 14:20:06 +02:00
Daniel Krebs
7bffe82e0e tests: add (dirty) RTDS test 2018-06-04 14:20:06 +02:00
Daniel Krebs
28143e7188 ips/rtds: add C++ version of RTDS IP 2018-06-04 14:20:06 +02:00
Daniel Krebs
a93278b74e ips/dma: expose names of its treaming ports 2018-06-04 14:20:06 +02:00
Daniel Krebs
8e63785073 ips/dma: change interface, get byte count from {read,write}Complete() 2018-06-04 14:20:06 +02:00
Daniel Krebs
07137d73e6 lib/ip: extend dump by memory blocks 2018-06-04 14:20:06 +02:00
Daniel Krebs
fcfb3d8020 lib: change include path: must be <villas/...> now 2018-06-04 14:20:06 +02:00
Daniel Krebs
7479675361 ips/intc: remove unused code 2018-06-04 14:20:06 +02:00
Daniel Krebs
2e339b406d lib/ips: add data fifo IP needed for stream routing 2018-06-04 14:20:06 +02:00
Daniel Krebs
a0c5acce4c ip-node: implement connect interface and update AxiStreamSwitch implementation 2018-06-04 14:20:06 +02:00
Daniel Krebs
a1daf95202 lib/card: lookup IP by identifier 2018-06-04 14:20:06 +02:00
Daniel Krebs
967e39e36c ip-node: add implementation of StreamGraph for automatic routing 2018-06-04 14:20:06 +02:00
Daniel Krebs
5f0d181a8e gitignore: add some QtCreator project files 2018-06-04 14:20:06 +02:00
Daniel Krebs
ff20f624a6 thirdparty: add CLI11 and rang header-only libraries 2018-06-04 14:20:06 +02:00
Daniel Krebs
63df68480f scripts/hwdef-parse: promote fifo to stream IP and populate all switch ports 2018-06-04 14:20:06 +02:00
Daniel Krebs
3a99bee400 scripts/non_root: also bind via pci BDF
Not sure if this is really needed though.
2018-06-04 13:24:57 +02:00
Daniel Krebs
5097827757 fix include paths, use <villas/...> style 2018-06-04 13:24:57 +02:00
Daniel Krebs
c15189b74b common/memory: implement freeing for LinearAllocator
This is still very simple. Only really free memory, when all allocation
have been deallocated so we only need to keep track of the current
number of allocations.
2018-05-16 11:27:03 +02:00
929ed2f393 Merge branch 'feature/gpu' into 'develop'
Add basic GPU/CUDA integration as a shared library

See merge request acs/public/villas/VILLASfpga-code!9
2018-05-16 11:15:36 +02:00
Daniel Krebs
d2384abb9d cmake: only build GPU library if CUDA is present 2018-05-16 10:58:18 +02:00
e91be5ed2c Merge branch 'feature/villas-common' into 'develop'
Start splitting common parts (plugin, logging, memory, ...) into a separate library

See merge request acs/public/villas/VILLASfpga-code!8
2018-05-15 18:49:26 +02:00
Daniel Krebs
13fd3f3c2a gpu: implement basic GPU plugin that can do DMA to and from its memory
Using CUDA, memory can be allocated on the GPU and shared to peers on
the PCIe bus such as the FPGA. Furthermore, the DMA on the GPU can also
be used to read and write to/from other memory on the PCIe bus, such as
BRAM on the FPGA.
2018-05-15 18:15:17 +02:00
Daniel Krebs
24db7ea1c0 tests/dma: update to current progress 2018-05-15 18:04:24 +02:00
Daniel Krebs
7dcdfaccd9 ips/dma: let user deal with making memory accessible to DMA
It is probably too costly to do (and verify) it on every read
or write. Furthermore, the user knows better how to make a certain
memory available to the DMA.
2018-05-15 18:04:24 +02:00
Daniel Krebs
f823dde0f4 card: don't try to create a VFIO mapping if IOMMU is disabled
In this case, VFIO cannot create DMA mappings.
2018-05-15 18:04:24 +02:00
Daniel Krebs
f644a9faa8 ips/pcie: move BAR0 mapping from card into PCIe IP 2018-05-15 18:04:24 +02:00
Daniel Krebs
89b5169a6e ips/pcie: parse AXI/PCI BARs and create mappings to/from PCIe address space
This is used for translations that don't use VFIO which used to bridge
the PCIe address space by creating direct mappings from process VA to
the FPGA. When we want to communicate directly via PCIe without the
involvment of the CPU/VFIO, we need the proper translations that are
configured in the FPGA hardware.
2018-05-15 18:04:24 +02:00
Daniel Krebs
364b137156 fpga/card: make pci device a class member (needed later) 2018-05-15 18:04:24 +02:00
Daniel Krebs
8f3833bc73 ips/dma: rename pingpong to memcpy and always connect loopback 2018-05-15 18:04:24 +02:00
Daniel Krebs
c818c242f3 kernel/pci: fix unitialized memory 2018-05-15 18:04:24 +02:00
Daniel Krebs
ad820a3618 kernel/pci: parse BAR regions 2018-05-15 18:04:24 +02:00
Daniel Krebs
2bfb9e2450 common/memory: expose method to dump memory graph to file 2018-05-15 18:04:24 +02:00
Daniel Krebs
e819829560 directed-graph: add dumping to dot-file (graphviz) 2018-05-15 18:04:24 +02:00
Daniel Krebs
1b2e7d312e common/memory: add host DMA memory allocator using udmabuf 2018-05-15 18:04:24 +02:00
Daniel Krebs
6b7d694103 common/BaseAllocator: test allocated memory for accessibility
Write to and read-verify allocated memory block when using allocate()
wrapper.
2018-05-15 18:04:24 +02:00
Daniel Krebs
2477ed4b4b common/memory: provide getPciAddressSpace() for a common PCIe address space 2018-05-15 18:04:24 +02:00
Daniel Krebs
1470490747 common/memory: provide findPath() to get a path of address spaces 2018-05-15 18:04:24 +02:00
Daniel Krebs
cea353aa7f directed-graph: add getters for vertices of an edge 2018-05-15 18:04:24 +02:00
Daniel Krebs
218008955e common/memory: fix memory translation merging 2018-05-15 18:04:24 +02:00
Daniel Krebs
105f47d2d0 common/memory: add check-callback to getPath() to select desired path
This is a workaround until we have a better heuristic (maybe shortest
path?) to choose between multiple paths in the graph. Since the (abstract)
graph has no idea about memory translations, getPath() may even yield
paths that are no valid translation because a pair of inbound/outbound
edges must not neccessarily share a common address window, but from the
perspective of the abstract graph present a valid path.
The callback function is used by the MemoryManager to verify if a path
candidate represents a valid translation.
2018-05-15 18:04:24 +02:00
Daniel Krebs
29709aed7a directed-graph: make compile with C++11 (no C++17 with CUDA) 2018-05-15 18:04:24 +02:00
Daniel Krebs
3f71793327 gpu: add gdrcopy submodule 2018-05-15 18:04:24 +02:00
Daniel Krebs
d81fc6fe11 gpu: add empty library for GPU-related stuff 2018-05-15 18:04:24 +02:00
Daniel Krebs
9490594167 allocator: properly remove memory block from memory graph 2018-05-15 18:04:24 +02:00
Daniel Krebs
68e5481d97 config: new config for changed bitstream
AXI-BAR0 on PCIe bridge now allows access to whole PCI address space.
2018-05-15 18:04:24 +02:00
Daniel Krebs
01803abade hwdef-parse: parse PCI and AXI BARs 2018-05-15 18:04:24 +02:00
Daniel Krebs
5b8f573337 json: parse 64bit numbers, this is required for numbers > 2^31
Our current JSON library jansson only parses signed integers, so
it cannot correctly parse numbers between 2^31 and 2^32 into a
32 bit type.
2018-05-15 18:04:24 +02:00
Daniel Krebs
c3993a22c6 vfio: IOMMU group is always 0 if no IOMMU is present 2018-05-15 18:04:24 +02:00
Daniel Krebs
80386d1085 vfio: correctly set container on group 2018-05-15 18:04:24 +02:00
Daniel Krebs
b6ff452e53 vfio: minor refactoring 2018-05-15 18:04:24 +02:00
Daniel Krebs
94ba899b21 vfio: track if IOMMU is enabled to prepare for non-IOMMU mode 2018-05-15 18:04:24 +02:00
Daniel Krebs
1f42f5bb63 common/cmake: add spdlog include and compatibility include (villas/...) 2018-05-15 18:03:36 +02:00
Daniel Krebs
9870749546 lib/common: move plugin, utils and memory stuf into common library 2018-04-23 10:07:40 +02:00
bd6d337442 Merge branch 'feature/blockram' into 'develop'
BRAM support + MemoryAllocator rework

See merge request acs/public/villas/VILLASfpga-code!7
2018-04-16 08:33:58 +02:00
Daniel Krebs
3e505c74bf ips/bram: add block RAM IP and use it with DMA test 2018-04-13 15:35:41 +02:00
Daniel Krebs
5242b87e4c lib/memory: rework allocators to make them extensible and more abstract
This is change renders memory allocators only dependend on an address
space id that they are managing, allowing easy implementation of other
algorithms and instantiation in memory IP blocks.
2018-04-13 15:35:41 +02:00
Daniel Krebs
ae2bd2a41d lib/ip: alias type for memory block name and cache addres space IDs in IP 2018-04-13 15:35:41 +02:00
0adac55ae6 Merge branch 'feature/packaging' into 'develop'
Added pkg-config file and CMake configuration for building RPM packages

See merge request acs/public/villas/VILLASfpga-code!6
2018-04-05 11:43:49 +02:00
cc3e042949 Merge branch 'develop' into 'feature/packaging'
# Conflicts:
#   CMakeLists.txt
2018-04-05 11:43:33 +02:00
174d539c7a Merge branch 'feature/dma-and-memory' into 'develop'
DMA IP and memory management

See merge request acs/public/villas/VILLASfpga-code!5
2018-04-05 11:42:06 +02:00
7e80f88d70 cpack: fix name of source tarbar 2018-04-05 11:39:53 +02:00
3f5bef34b3 added pkg-config file and CMake configuration for building RPM packages 2018-04-05 11:29:16 +02:00
Daniel Krebs
8954e65b4f kernel/vfio: some more cleanup 2018-03-26 16:45:54 +02:00
Daniel Krebs
192aa10627 kernel/vfio: fix check for vfio extensions 2018-03-26 16:17:51 +02:00
Daniel Krebs
ce7e6b36d5 kernel/vfio: check if all required kernel modules are loaded 2018-03-26 16:17:44 +02:00
Daniel Krebs
e28345b992 tests/dma: add test for DMA driver 2018-03-26 16:17:26 +02:00
Daniel Krebs
507ea77ad6 ips/dma: add (simple) DMA driver 2018-03-26 16:17:26 +02:00
Daniel Krebs
4f6694420f lib: remove old and unused C files 2018-03-26 16:17:26 +02:00
Daniel Krebs
f025f5dcc7 lib/ip: read base addresses from JSON into unsigned integer
This caused sign extension for addresses with the MSB set which is
obviously wrong since this is an address and not a number. With
Jansson, there seems to be now other way since it only supports
reading (signed) integers.
2018-03-26 16:17:26 +02:00
Daniel Krebs
aa1592ae2b utils: read_random() now returns the number of bytes written 2018-03-26 16:17:26 +02:00
Daniel Krebs
2724622787 kernel/pci: make some arguments const and fix debug output 2018-03-26 16:17:26 +02:00
Daniel Krebs
60882f1086 lib/memory: implement memory handling with allocators and blocks
This commit is 2/2 of a series of patches and not working on its own.
2018-03-26 16:17:20 +02:00
Daniel Krebs
b01a50184c kernel/vfio: port to C++
This commit is 1/2 of a series of patches and not working on its own.
2018-03-26 16:16:42 +02:00
Daniel Krebs
ac483b2110 scripts: fix non-root script
* load IOMMU type 1 kernel module
 * determine IOMMU group dynamically
 * add user dkr to fpga group
2018-03-26 15:19:24 +02:00
Daniel Krebs
b21d6ddb9d src: do not compile C benchmarks anymore 2018-03-26 11:10:56 +02:00
Daniel Krebs
64a89c2981 lib/ip: add debug output for 2-stage initialization 2018-02-14 16:45:41 +01:00
Daniel Krebs
676fd9171c lib/ip: make logger a class member of IpCore
Logging is used everywhere and there's no justification of the clutter
and runtime overhead of `aut logger = getLogger();` everywhere.
2018-02-14 16:04:33 +01:00
Daniel Krebs
aa2b0b324f lib/ips/pcie: use cached address space id and supply interface to create mapping 2018-02-14 14:34:03 +01:00
Daniel Krebs
36259d00e0 lib/ip: save address space ids for each bus master interface 2018-02-14 14:34:03 +01:00
Daniel Krebs
5d99f11a34 lib/ip: move definition of getBaseAddr() back to header
This is a one-liner, so IMO increases readability.
2018-02-14 14:34:03 +01:00
Daniel Krebs
e8ef3e4380 lib/memory-manager: pass strings as const reference 2018-02-14 14:34:03 +01:00
Daniel Krebs
73c6ae1f71 hwdef-parse: follow OR-gate merging DMA interrupts
Also update JSON config with the new output.
2018-02-14 14:34:03 +01:00
Daniel Krebs
6cb3b77c7a ips/intc: don't fail if setting IRQ affinity is not possible
This is the case when the application is not executed as root which is
now possible, with the drawback that we cannot set the IRQ affinity
anymore.
2018-02-14 14:32:07 +01:00
Daniel Krebs
e2ce250288 lib: remove leftover (warning) compiler options
These are now set in the root CMakeLists.txt
2018-02-14 10:06:55 +01:00
231050d734 Merge branch 'feature/memory-manager-rebased' into 'develop'
Graph-based memory-manager for translating between addressspaces

See merge request acs/public/villas/VILLASfpga-code!4
2018-02-14 07:31:26 +01:00
Daniel Krebs
5940dcc0e5 lib/ips/fifo: remove useless code and old cruft 2018-02-14 07:28:25 +01:00
Daniel Krebs
3a8e332b42 lib/vlnv: add != operator and minor cleanup 2018-02-14 07:28:25 +01:00
Daniel Krebs
817d206243 lib/ip: formatting cleanup and more comments 2018-02-14 07:28:25 +01:00
Daniel Krebs
41e90bfda0 lib/ip: cleanup operators 2018-02-14 07:28:25 +01:00
Daniel Krebs
503d6b7f07 lib/ip: cleanup formatting and comments of IpCore's member variables 2018-02-14 07:28:25 +01:00
Daniel Krebs
e66350dbf6 tests: minor fixes in logging 2018-02-14 07:28:25 +01:00
Daniel Krebs
21333379a9 lib/ips/fifo: fix decision if AXI4 data interface is present 2018-02-14 07:28:25 +01:00
Daniel Krebs
e93b31bbf1 lib/ips: make use of MemoryManager and new config layout 2018-02-14 07:28:25 +01:00
Daniel Krebs
acf273e406 tests: let them fail if no Fifo or Timer is found 2018-02-14 07:27:37 +01:00
Daniel Krebs
ef5f6fa3a8 lib/card: use memory manager to store vfio mapping 2018-02-14 07:27:37 +01:00
Daniel Krebs
5b0013b335 lib/card: add IP lookup by VLNV 2018-02-14 07:27:37 +01:00
Daniel Krebs
c3382b9e18 lib/card: pass string as const reference to lookupIp() 2018-02-14 07:27:37 +01:00
Daniel Krebs
95e29f2706 memory-manager: allow for traversing address spaces
Major rework of the memory manager. Adds a memory translation class to
resolve addresses across address spaces and extents the memory manager
in order to do so.
2018-02-14 07:27:37 +01:00
Daniel Krebs
035c6f8b2a lib/kernel/vfio: add function to get size of device memory region 2018-02-14 07:27:37 +01:00
Daniel Krebs
33ba634d87 lib/directed-graph: add findVertex() and minor refactoring 2018-02-14 07:27:37 +01:00
Daniel Krebs
02e873e8ff lib/ip: remove dependency graph
Replace by static list of VLNVs that will be initialized first.
2018-02-14 07:27:37 +01:00
Daniel Krebs
95adaad32f etc/json: update config file with current output of hwdef-parse 2018-02-14 07:26:39 +01:00
Daniel Krebs
912c3729d4 lib/ip: improve readability 2018-02-14 07:26:39 +01:00
Daniel Krebs
be3538f697 hwdef-parse: fix switch/num_port to be an integer 2018-02-14 07:26:39 +01:00
Daniel Krebs
44ad827121 hwdef-parse: treat PCIe bridge the same as all other IPs
This is needed in order to construct a global memory graph.
2018-02-14 07:26:39 +01:00
Daniel Krebs
7d927155db tests: minimal test of memory manager 2018-02-14 07:26:39 +01:00
f621cfc984 Merge branch 'fix/directed_graph_loop_detection_bug' into 'develop'
directed-graph: fix bug in loop detection

See merge request acs/public/villas/VILLASfpga-code!1
2018-02-14 07:22:59 +01:00
bd1a5e6886 Merge branch 'feature/cpp_warnings' into 'develop'
enable -Wall, -Wextra and -Werror

Closes #20

See merge request acs/public/villas/VILLASfpga-code!3
2018-02-14 07:22:00 +01:00
Daniel Krebs
10745f00b5 libxil: update submodule
Only add temporary files to gitignore
2018-02-13 16:15:28 +01:00
Daniel Krebs
409340433d enable -Wall, -Wextra and -Werror and fix new errors (fixes #20) 2018-02-13 16:04:34 +01:00
Daniel Krebs
6dab50824b directed-graph: fix bug in loop detection 2018-02-13 09:54:31 +01:00
3257ee00c0 Merge branch 'feature/criterion-spdlog' into develop 2018-01-31 20:28:04 +01:00
8d404111b4 Merge branch 'develop' of git.rwth-aachen.de:acs/public/villas/VILLASfpga-code into develop 2018-01-31 20:27:14 +01:00
8206f867a5 logging: use similar log style in all modules 2018-01-31 20:24:11 +01:00
2336acaf98 tests: override some criteriod_log() functions in order to use spdlog style log output 2018-01-31 20:23:48 +01:00
51a3d0b8e9 tests: some cleanups 2018-01-31 20:22:15 +01:00
2a03d19d53 tests: readd missing graph test suite 2018-01-31 15:12:36 +01:00
b0f4577dd3 tests: automatically detect whether or not we can run tests in parallel 2018-01-31 15:12:19 +01:00
0aed1a1b12 tests: moved initialization of FPGA stuff to fpga.cpp 2018-01-31 15:11:13 +01:00
Daniel Krebs
32be16ef98 tests/graph: move criterion setup to from main.cpp to graph.cpp 2018-01-31 11:21:02 +01:00
Daniel Krebs
3de2170ad6 tests: move variables to global state and set criterion jobs to 1 2018-01-31 11:17:21 +01:00
Daniel Krebs
959a6130d3 Merge branch 'feature/cpp' into develop
Current work-in-progress of porting to C++
2018-01-31 10:38:42 +01:00
1b6d0d7700 Merge branch 'feature/hw-testing' into feature/cpp (closes #14 and #15) 2018-01-30 19:38:49 +01:00
3c7f6e968b do parallel build 2018-01-30 19:36:39 +01:00
e25a3e24bc cleanup build dir before building 2018-01-30 19:35:03 +01:00
4a4a5fe176 tiny change 2018-01-30 19:32:22 +01:00
a45de4ec1a FPGA tests fail if we attempt to run them in parallel 2018-01-30 19:27:22 +01:00
bb6d31a971 Merge branch 'feature/non-root' into feature/hw-testing 2018-01-30 19:26:38 +01:00
Daniel Krebs
5a7989d552 lib/memory-manager: start implementation using DirectedGraph 2018-01-30 19:16:59 +01:00
Daniel Krebs
ba7531ac46 lib/graph: allow stringifying of vertex and edge derived types
This yields nices debug messages and a much nice dump().
2018-01-30 19:16:59 +01:00
Daniel Krebs
22ce8f2b3f lib/graph: slightly change interface to allow for custom edges 2018-01-30 19:16:59 +01:00
Daniel Krebs
201bbde4b6 lib/graph: move identifiers into classes 2018-01-30 19:16:59 +01:00
4f86b98fdd add script to configure system for non-root access to FPGA 2018-01-30 19:15:45 +01:00
3047f5bb7a vfio: only rebind pci device to VFIO driver if not already bound 2018-01-30 19:09:56 +01:00
293f496db0 pci: add function to get currently loaded kernel driver 2018-01-30 19:09:19 +01:00
269550c5dc install libraries to fix loading of libvillas-fpga.so 2018-01-30 18:38:15 +01:00
abeaa0b077 execute FPGA unit on acs-villas 2018-01-30 18:27:13 +01:00
bd4f547e97 fix wrong tag in gitlab-ci.yml 2018-01-30 18:13:09 +01:00
c3129b35eb use official Fedora image as base 2018-01-30 17:55:34 +01:00
1bbe0c2855 enable unit tests on CI 2018-01-30 17:54:51 +01:00
b202fa9e7d docker: fix invalid tag name 2018-01-30 17:36:49 +01:00
ef9a31ea52 fix path of submodule 2018-01-30 17:35:46 +01:00
Daniel Krebs
27c67f206e lib/graph: add path-finding with loop detection and corresponding unittest 2018-01-30 17:28:42 +01:00
Daniel Krebs
ec8e9a1cd1 lib/ip-node: remove dangling function prototype 2018-01-30 15:13:23 +01:00
Daniel Krebs
7582966e16 lib: first draft of memory manager 2018-01-30 15:13:23 +01:00
Daniel Krebs
f6c02b8429 lib: add directed graph implementation incl. unittest 2018-01-30 15:13:23 +01:00
Daniel Krebs
aa33a8e028 libxil: update upstream path 2018-01-30 15:10:25 +01:00
daniel-k
f14df8aa32 lib/ip: adapt to fit new config layout provided by hwdef-parse 2018-01-23 14:47:44 +01:00
daniel-k
92aea92f19 etc: update fpga.json with output of hwdef-parse 2018-01-23 14:43:53 +01:00
daniel-k
e46720d23b tests: improve logging 2018-01-23 14:43:30 +01:00
daniel-k
62e1a7d962 tests/fifo: fail if connecting loopback doesn't work 2018-01-23 14:43:06 +01:00
daniel-k
f642fa6428 log: provide more macros for text colors 2018-01-23 14:42:26 +01:00
daniel-k
bbff2c9a88 hwdef-parse: count total switch ports and populate property 2018-01-23 14:41:31 +01:00
daniel-k
fb37253623 hwdef-parse: populate all memory ranges based on name
This used to overwrite earlier memory ranges because the same was
used ('baseaddr', 'highaddr'). Now, deduce name from BASENAME and
remove prefix `C_`.
2018-01-23 14:38:12 +01:00
daniel-k
02ea98dd97 hwdef-parse: add port name 2018-01-23 12:30:54 +01:00
daniel-k
28a7f2a3ee spdlog: fix handling of too long logger names
`whitespace` overflows because the result implicitly is an unsigned
value.
2018-01-23 10:09:06 +01:00
daniel-k
df93004720 scripts/hwdef-parse: include intc instance name in irq ports 2018-01-17 17:00:00 +01:00
daniel-k
935fa847aa scripts/hwdef-parse: update ports format 2018-01-17 16:51:02 +01:00
daniel-k
4db0a98082 scripts/hwdef-parse: add memory view for each instance 2018-01-17 16:51:02 +01:00
daniel-k
f5a3c8c712 scripts/hwdef-parse: only set irqs and ports if there are any 2018-01-17 16:31:47 +01:00
daniel-k
21d1dd0a71 tests/timer: test absolute timing 2018-01-16 15:26:19 +01:00
daniel-k
61de103c9e tests/main: assert that there's an fpga 2018-01-16 15:08:56 +01:00
daniel-k
16455bdd13 tests/fifo: cleanup 2018-01-16 15:08:27 +01:00
daniel-k
e626abfb52 tests/timer: add basic timer test 2018-01-16 15:08:12 +01:00
daniel-k
fc98aaecb4 lib/ips/intc: C++-ify interface 2018-01-16 15:07:21 +01:00
daniel-k
e05ff515c7 lib/ips/timer: implement basic functionality 2018-01-16 15:05:37 +01:00
daniel-k
05131258d4 lib/card: use new logger 2018-01-16 14:52:09 +01:00
daniel-k
77135feebc lib/ips/intc: use new logger 2018-01-16 14:51:45 +01:00
daniel-k
80bc9af0e7 lib/ips/intc: change waitForInterrupt() interface
Return -1 on failure, change type to `int`. int/2 bits should still
be enough to track overflowed interrupts.
2018-01-16 14:51:45 +01:00
daniel-k
82204990cd lib/card: remove unused C code 2018-01-16 14:46:59 +01:00
daniel-k
f987c29d71 lib/ip: change interface: start() -> init() 2018-01-16 14:46:00 +01:00
daniel-k
687f1e5bba lib/ips/fifo: use std:min in favor of old macro 2018-01-10 15:49:53 +01:00
daniel-k
44e78643ea lib/log: purge remaining of old logger 2018-01-10 15:49:53 +01:00
daniel-k
09534e83a6 lib/plugin: make type an argument of constructor 2018-01-10 15:49:53 +01:00
daniel-k
3cf50db98d logging: use new spdlog library in favor of Logger 2018-01-10 15:49:53 +01:00
daniel-k
f2a5e7af22 spdlog: patch name formatter to implement fixed width names in format 2018-01-10 15:42:03 +01:00
daniel-k
b33b4d27d9 Merge commit '2cfd26b6ee2696a0e23b9caa72b89078d8428b94' as 'thirdparty/spdlog' 2018-01-10 15:24:09 +01:00
daniel-k
2cfd26b6ee Squashed 'thirdparty/spdlog/' content from commit 32177aa
git-subtree-dir: thirdparty/spdlog
git-subtree-split: 32177aa77a0a20453d3e7455cac42406fc49b6ca
2018-01-10 15:24:09 +01:00
daniel-k
71a54eeab6 lib/ips: implement fifo driver and adapt test 2018-01-10 11:02:08 +01:00
daniel-k
e2e78cf8b3 lib: minor cleanup 2018-01-10 11:02:08 +01:00
daniel-k
da88b15af3 lib/ip: fail making if configureJson() fails 2018-01-10 11:02:08 +01:00
daniel-k
81db98e448 lib/ip-node: implement loopback mode if available 2018-01-10 11:02:08 +01:00
daniel-k
6ee860971a ips/intc: supply methods to use with new IrqPort 2018-01-10 11:02:08 +01:00
daniel-k
c710a95352 lib/ip: generalize getting mapped addresses 2018-01-10 11:02:08 +01:00
daniel-k
4035aab49f lib/ip: dependencies cannot be private
Has to be used by derived classes of course!
2018-01-10 11:02:08 +01:00
daniel-k
e96b08c53c lib/ip: implement more comparison operators for IpCore 2018-01-10 11:02:08 +01:00
daniel-k
8345a15db0 lib/card: implement IP lookup
Search for an initialized IP by name.
2018-01-10 11:02:08 +01:00
daniel-k
af234e29c6 lib/ip: provide default implementation for getDependencies() 2018-01-10 11:02:08 +01:00
daniel-k
cb25861c7e ip: remove excess space in output of identifier 2018-01-10 11:02:08 +01:00
daniel-k
018c89a2b0 tests/main: C++-ify 2018-01-10 11:02:08 +01:00
daniel-k
25d5552197 ips/intc: remove early return in start() 2018-01-10 11:02:08 +01:00
daniel-k
f94476b716 ip/node: rename OtherIpNode to StreamPort and other to to 2018-01-10 11:02:08 +01:00
daniel-k
4d3e4dd931 ips: make irqs a list 2018-01-10 11:02:08 +01:00
daniel-k
79f37ce352 ips/switch: add C++ implementation of switch 2018-01-10 11:02:08 +01:00
daniel-k
12024d53e5 lib/ip-node: add IpNode class, IpCore which has streaming ports 2018-01-10 11:02:08 +01:00
daniel-k
f3f0f4d630 lib/ip: pass ip core by reference to factory instead of unique_ptr 2018-01-10 11:02:08 +01:00
daniel-k
9676a9535d lib/ip: re-add IRQ to IpCore 2018-01-10 11:02:08 +01:00
daniel-k
ab183d2111 lib/ip: flip output of IpIdentifier (name first, VLNV second) 2018-01-10 11:02:08 +01:00
daniel-k
c105f1c925 lib/ip: remove unused includes and replace pragma by include guard 2018-01-10 11:02:08 +01:00
daniel-k
a5b5e317d4 wip implementing dependency parsing and proper memeory handling
works and compiles so for. next is to implement different IP interfaces
(Model, Interface, DataMover, Infrastructure, ...)
2018-01-10 11:02:08 +01:00
daniel-k
6a721847e4 set C++ standard to C++17
Primarily for structured binding declaration in range-based for loops
2018-01-10 11:02:08 +01:00
daniel-k
61ca7aa44f fpga/ip: add C++ timer implementation 2018-01-10 11:02:08 +01:00
daniel-k
3d0afd671e lib/utils: add string tokenizer 2018-01-10 11:02:08 +01:00
daniel-k
35d96ed277 lib: add dependency graph implementation 2018-01-10 11:02:08 +01:00
daniel-k
e590d1a350 add namespace villas::fpga and villas::fpga::ip and some renaming 2018-01-10 11:02:08 +01:00
daniel-k
09815a661e rough implementation of a C++ style logger class
with many sharp edges :)
2018-01-10 11:02:08 +01:00
daniel-k
b0e55e6fb2 current wip implementing card, many changes in ip too 2018-01-10 11:02:08 +01:00
daniel-k
63a443527c plugin: treat empty name in lookup() as wildcard 2018-01-10 11:02:08 +01:00
daniel-k
2bf8bf93bd ips/intc: remove configureJson() method because not needed 2018-01-10 11:02:08 +01:00
daniel-k
a194f8d0b2 plugin: require name and add method to dump list 2018-01-10 11:02:08 +01:00
daniel-k
d63c2b30bf tests: compile main as C++ 2018-01-10 11:02:08 +01:00
daniel-k
7d883089c2 lib/card: copy C->C++ and just make it compile 2018-01-10 11:02:08 +01:00
daniel-k
68c9f08457 plugin: use Nifty Counter Idiom to intialize plugin list
Just using a standard std::list<> to hold plugins is problematic, because
we want to push Plugins to the list from within each Plugin's constructor
that is executed during static initialization. Since the order of static
initialization is undefined in C++, it may happen that a Plugin
constructor is executed before the list could be initialized. Therefore,
we use the Nifty Counter Idiom [1] to initialize the list ourself before
the first usage.

In short:
- allocate a buffer for the list
- initialize list before first usage
- (complicatedly) declaring a buffer is neccessary in order to avoid
  that the constructor of the static list is executed again
2018-01-10 11:02:08 +01:00
daniel-k
151abd2fd5 re-add old interrupt controller to make project compile again 2018-01-10 11:02:08 +01:00
daniel-k
e735c7e248 make linking of the lib work by using old C-symbols until replaced 2018-01-10 11:02:08 +01:00
daniel-k
5d4040aded first port to C++ of plugin and fpga ip infrastructure 2018-01-10 11:02:08 +01:00
daniel-k
f0c089f719 simple renames to not use reserved names 2018-01-10 11:02:08 +01:00
daniel-k
4adb889527 make ips/intc C++ 2018-01-10 11:02:08 +01:00
14150f158f fix CI 2017-12-29 15:48:04 +01:00
daniel-k
babec9a574 kernel/pci: fix pci device compare function
list_search's compare function has to return 0 on match.
2017-11-28 12:08:32 +01:00
daniel-k
eeafb2bcc6 etc/fpga: card is in slot 03:00.0 currently 2017-11-28 12:06:26 +01:00
daniel-k
737a5851df lib/card: start FPGA card prior to parsing
Initializing IPs may want to probe the actual hardware for feature
detection (e.g. DMA), so the card has to be started in order to access
any memory on the card.
2017-11-28 11:26:41 +01:00
daniel-k
d67a120902 tests/dma: fix chunk size for simple DMA (should have been 4k) 2017-11-22 19:47:04 +01:00
daniel-k
c67c8aac5b tests: add fpga.json and correctly parse it for unit tests 2017-11-22 19:46:07 +01:00
daniel-k
0bf00d51d7 lib: create shared instead of static library 2017-11-22 19:41:02 +01:00
daniel-k
1cde762fc0 ips/gpio: add skeleton for GPIO IP 2017-11-22 19:40:22 +01:00
daniel-k
db79fe4827 lib/pci: initialize list and ignore special dir entries 2017-11-22 11:21:27 +01:00
daniel-k
1fcabd1bdd lib/card: fix assignment in assertion 2017-11-22 11:20:44 +01:00
a5845eb397 add LAPACK dependency to Dockerfile 2017-11-21 23:06:42 +01:00
149139aa34 fix CI 2017-11-21 23:05:22 +01:00
668fa2eb78 use https submodules 2017-11-21 23:02:16 +01:00
a7c15e618c add missing benchmarks 2017-11-21 22:30:21 +01:00
8e0e7a4098 added gitignore 2017-11-21 21:33:50 +01:00
f95d65a45f added fodler for bitstreams 2017-11-21 21:33:19 +01:00
c3164e93ef imported source code from VILLASfpga repo and made it compile 2017-11-21 21:31:08 +01:00
01130e6fa4 added simple Dockerfile for development 2017-11-21 21:29:34 +01:00
a288295e43 created new repo for VILLASfpga 2017-11-21 21:28:21 +01:00
1114 changed files with 88674 additions and 46829 deletions

9
.clang-format Normal file
View file

@ -0,0 +1,9 @@
# Author: Steffen Vogel <steffen.vogel@opal-rt.com>
# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH
# SPDX-License-Identifier: Apache-2.0
---
BasedOnStyle: LLVM
# Disable automatic line-breaks in comments
# as this breaks SPDX headers
ReflowComments: false

6
.clangd Normal file
View file

@ -0,0 +1,6 @@
# Author: Steffen Vogel <steffen.vogel@opal-rt.com>
# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH
# SPDX-License-Identifier: Apache-2.0
---
Diagnostics:
UnusedIncludes: Strict

View file

@ -1,20 +1,28 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp
{
"name": "VILLASnode",
"image": "registry.git.rwth-aachen.de/acs/public/villas/node/dev-vscode:master",
// Uncomment to build the devcontainer locally
// "build": {
// "dockerfile": "../packaging/docker/Dockerfile.fedora",
// "target": "dev-vscode",
// "context": ".."
// },
"remoteUser": "villas",
"runArgs": [ "--privileged", "--security-opt", "seccomp=unconfined"],
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"EditorConfig.EditorConfig"
],
"name": "VILLASnode",
"image": "registry.git.rwth-aachen.de/acs/public/villas/node/dev-vscode",
// Uncomment to build the devcontainer locally
// "build": {
// "dockerfile": "../packaging/docker/Dockerfile.fedora",
// "target": "dev-vscode",
// "context": ".."
// },
"remoteUser": "villas",
"runArgs": [
"--privileged",
"--security-opt",
"seccomp=unconfined"
],
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools-extension-pack",
"llvm-vs-code-extensions.vscode-clangd",
"xaver.clang-format",
"EditorConfig.EditorConfig"
]
}
}
}

View file

@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
build/
build_*/
packaging/docker/Dockerfile.*

View file

@ -1,22 +1,31 @@
# EditorConfig is awesome: http://EditorConfig.org
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace=true
# Matches multiple files with brace expansion notation
# Set default charset
[{etc,include,lib,plugins,src,tests,tools,common}/**.{c,h,proto,cpp,hpp,h.in,hpp.in}]
charset = utf-8
indent_style = tab
indent_size = 8
trim_trailing_whitespace=true
[*.{c,h,proto,cpp,hpp,h.in,hpp.in}]
indent_style = space
indent_size = 2
[*.py]
indent_style = space
indent_size = 4
[*.conf]
charset = utf-8
indent_style = tab
indent_size = 8
indent_style = space
indent_size = 4
[*.{nix,json}]
indent_style = space
indent_size = 2

4
.envrc Normal file
View file

@ -0,0 +1,4 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
use flake

21
.git-blame-ignore-revs Normal file
View file

@ -0,0 +1,21 @@
# Author: Steffen Vogel <steffen.vogel@opal-rt.com>
# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH
# SPDX-License-Identifier: Apache-2.0
# Introduced clang-format
aa16979fdde7cd377977c38eaee02062c3908515
# Make project REUSE compliant
0735eb0f89c976ba8db7abeae7814060fb5dfe3c
# Update Steffens mail address
7eec1bb75339c60cefe5e9e558d9394e0cceecb6
# Introduced clang-format in common/
5324b788bdd93b3e142a9f53b931dbfc8c3ed39d
# Make project REUSE compliant in common/
b1e8cd81da9a3e3d27db27d49d265afc53e0ce4d
# Update Steffens mail address in common/
6427fae1e4ca0467e09688d56cec0dcd7d5e600d

19
.gitignore vendored
View file

@ -1,20 +1,29 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
/build*/
*~
*.swp
.clang_complete
.project
.cproject
.settings/
.vscode/
.direnv/
.cache/
*.swp
*.pyc
*.a
*.o
*.so
*.user
*.egg-info/
compile_commands.json
python/dist/
python/.eggs/
# YouCompleteMe
.ycm_extra_conf.py
*.pyc
python/.eggs/
go/lib/_obj/
graph.dot

View file

@ -1,122 +1,163 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_DEPTH: 0
DISTRO: fedora # standard distro
DISTRO: fedora # Standard distribution
DOCKER_FILE: packaging/docker/Dockerfile.${DISTRO}
DOCKER_TAG: ${CI_COMMIT_REF_NAME}
DOCKER_IMAGE: registry.git.rwth-aachen.de/acs/public/villas/node
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-${DISTRO}
DOCKER_CLI_EXPERIMENTAL: enabled
MAKE_OPTS: "-j16"
CMAKE_OPTS: "-DWITH_FPGA=OFF"
CMAKE_BUILD_OPTS: "--parallel 16"
CMAKE_EXTRA_OPTS: "-DCMAKE_BUILD_TYPE=Release -DVILLAS_COMPILE_WARNING_AS_ERROR=ON"
stages:
- prepare
- build
- test
- packaging
- deploy
- latest
- prepare
- build
- test
- packaging
- deploy
- latest
# Stage: prepare
##############################################################################
# Build docker image which is used to build & test VILLASnode
prepare:docker:
stage: prepare
image: docker:20.10
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker build ${DOCKER_OPTS}
- docker build ${DOCKER_OPTS}
--file ${DOCKER_FILE}
--tag ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
--target dev .
--target ${TARGET} .
- docker push ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
variables:
TARGET: dev
parallel:
matrix:
- DISTRO: [ ubuntu, debian, rocky ]
- DISTRO: fedora
DOCKER_OPTS: --tag ${DOCKER_IMAGE}/dev:${CI_COMMIT_REF_NAME}
- DISTRO: fedora
DOCKER_FILE: packaging/docker/Dockerfile.fedora-minimal
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-fedora-minimal
- DISTRO: [ubuntu, debian, rocky]
- DISTRO: fedora
DOCKER_OPTS: --tag ${DOCKER_IMAGE}/dev:${DOCKER_TAG}
- DISTRO: fedora
DOCKER_FILE: packaging/docker/Dockerfile.fedora-minimal
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-fedora-minimal
- DISTRO: fedora
TARGET: dev-vscode
DOCKER_IMAGE_DEV: ${DOCKER_IMAGE}/dev-vscode
tags:
- docker
- docker-image-builder
# Stage: build
##############################################################################
build:source:
stage: build
needs: ["prepare:docker"]
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
script:
- mkdir -p build && cd build
- cmake ${CMAKE_OPTS} ${CMAKE_EXTRA_OPTS} ..
- make ${MAKE_OPTS}
- cmake -S . -B build ${CMAKE_OPTS} ${CMAKE_EXTRA_OPTS}
- cmake --build build ${CMAKE_BUILD_OPTS}
artifacts:
expire_in: 1 week
paths:
- build/
- build/
variables:
CMAKE: cmake
parallel:
matrix:
- DISTRO: [ fedora, fedora-minimal, debian, rocky, ubuntu ]
- DISTRO: fedora-minimal
CMAKE_EXTRA_OPTS: -DWITH_API=OFF
-DWITH_CLIENTS=OFF
-DWITH_CONFIG=OFF
-DWITH_DOC=OFF
-DWITH_FPGA=OFF
-DWITH_GRAPHVIZ=OFF
-DWITH_HOOKS=OFF
-DWITH_LUA=OFF
-DWITH_OPENMP=OFF
-DWITH_PLUGINS=OFF
-DWITH_SRC=OFF
-DWITH_TESTS=OFF
-DWITH_TOOLS=OFF
-DWITH_WEB=OFF
-DCMAKE_MODULE_PATH=/usr/local/lib64/cmake
-DCMAKE_PREFIX_PATH=/usr/local
tags:
- docker
- DISTRO: [fedora, fedora-minimal, debian, rocky, ubuntu]
- DISTRO: fedora-minimal
CMAKE_EXTRA_OPTS: -DVILLAS_COMPILE_WARNING_AS_ERROR=ON
-DWITH_API=OFF
-DWITH_CLIENTS=OFF
-DWITH_CONFIG=OFF
-DWITH_DOC=OFF
-DWITH_FPGA=OFF
-DWITH_GRAPHVIZ=OFF
-DWITH_HOOKS=OFF
-DWITH_LUA=OFF
-DWITH_OPENMP=OFF
-DWITH_PLUGINS=OFF
-DWITH_SRC=OFF
-DWITH_TESTS=OFF
-DWITH_TOOLS=OFF
-DWITH_WEB=OFF
-DCMAKE_MODULE_PATH=/usr/local/lib64/cmake
-DCMAKE_PREFIX_PATH=/usr/local
build:nix:
stage: build
image: nixos/nix
needs: []
artifacts:
when: on_success
access: all
expire_in: "1 year"
paths:
- artifacts/villas
before_script:
- | # Create artifacts directory
mkdir artifacts
- | # Configure Nix
echo "experimental-features = flakes nix-command" >> /etc/nix/nix.conf
# - | # Configure Attic
# nix shell nixpgks#attic-client
# attic login nulll https://cache.0l.de ${ATTIC_TOKEN}
# attic use "nulll:villas"
script:
- nix build --print-build-logs .
- | # Build ARX bundle
nix bundle --out-link villas .
cp -L villas artifacts/villas
- | # Build Docker image
nix run nixpkgs#skopeo -- login \
--username ${CI_REGISTRY_USER} \
--password ${CI_REGISTRY_PASSWORD} \
${CI_REGISTRY}
nix build '.#dockerImage'
nix run nixpkgs#skopeo -- copy --insecure-policy \
"docker-archive:./result" \
"docker://${DOCKER_IMAGE}:${DOCKER_TAG}-nix"
# after_script:
# - | # Push whole store to cache
# nix shell nixpgks#attic-client
# attic push /nix/store/*
# Stage: test
##############################################################################
test:flake8:
test:python:
stage: test
script:
- flake8 python/
- cd python
- /venv/bin/pytest --verbose .
- /venv/bin/black --extend-exclude=".*(\\.pyi|_pb2.py)$" --check .
- /venv/bin/flake8 --extend-exclude="*.pyi,*_pb2.py" .
- /venv/bin/mypy .
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
tags:
- docker
needs:
- job: "build:source: [fedora]"
- job: "build:source: [fedora]"
test:cppcheck:
stage: test
script:
- cppcheck -j $(nproc)
--max-configs=32
--error-exitcode=1
--quiet
--inline-suppr
--enable=warning,performance,portability,missingInclude
--std=c++11
--suppress=noValidConfiguration
-U '_MSC_VER;_WIN32;_M_ARM'
-U '_MSC_VER;_WIN32;_M_AMD64;_M_X64'
-U '_MSC_FULL_VER;_MSC_VER'
-U '_MSC_BUILD;_MSC_VER'
-I include
-I common/include
src/ lib/ tests/unit/ | tee cppcheck.log
- ./tools/run-cppcheck.sh | tee cppcheck.log
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
tags:
- docker
needs:
- job: "build:source: [fedora]"
- job: "build:source: [fedora]"
artifacts:
when: on_failure
paths:
@ -126,73 +167,64 @@ test:cppcheck:
test:unit:
stage: test
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
variables:
LD_PRELOAD: /usr/lib64/libSegFault.so
SEGFAULT_SIGNALS: all
script:
- mkdir -p build && cd build
- cmake ${CMAKE_OPTS} ..
- make ${MAKE_OPTS} run-unit-tests
tags:
- docker
- cmake -S . -B build ${CMAKE_OPTS}
- cmake --build build ${CMAKE_BUILD_OPTS} --target run-unit-tests run-unit-tests-common
needs:
- job: "build:source: [fedora]"
artifacts: true
- job: "build:source: [fedora]"
artifacts: true
test:integration:
stage: test
image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
script:
- mkdir -p build && cd build
- cmake ${CMAKE_OPTS} ..
- make ${MAKE_OPTS} run-integration-tests
- cmake -S . -B build ${CMAKE_OPTS}
- cmake --build build ${CMAKE_BUILD_OPTS} --target run-integration-tests
artifacts:
name: ${CI_PROJECT_NAME}-integration-tests-${CI_BUILD_REF}
when: always
paths:
- build/tests/integration/
- build/tests/integration/
services:
- name: eclipse-mosquitto:2.0
alias: mosquitto
command: [ mosquitto, -c, /mosquitto-no-auth.conf ]
- name: rwthacs/rabbitmq
alias: rabbitmq
- name: redis:6.2
alias: redis
tags:
- docker
- name: eclipse-mosquitto:2.0
alias: mosquitto
command: [mosquitto, -c, /mosquitto-no-auth.conf]
- name: rwthacs/rabbitmq
alias: rabbitmq
- name: redis:6.2
alias: redis
needs:
- job: "build:source: [fedora]"
artifacts: true
- job: "build:source: [fedora]"
artifacts: true
test:reuse:
stage: test
needs: []
image:
name: fsfe/reuse:latest
entrypoint: [""]
script:
- reuse lint
# Stage: packaging
##############################################################################
pkg:docker:
stage: packaging
image: docker:20.10
before_script:
- mkdir -p ~/.docker/cli-plugins/
- wget -O ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/v0.6.3/buildx-v0.6.3.linux-amd64
- chmod a+x ~/.docker/cli-plugins/docker-buildx
- docker buildx create --use --name cross-platform-build --buildkitd-flags "--allow-insecure-entitlement security.insecure"
- docker buildx inspect --bootstrap cross-platform-build
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker buildx build ${DOCKER_OPTS}
- docker build ${DOCKER_OPTS}
--pull
--allow security.insecure
--output type=docker
--target ${TARGET}
--build-arg ARCH=${ARCH}
--build-arg TRIPLET=${TRIPLET}
--build-arg CMAKE_OPTS="${CMAKE_OPTS}"
--build-arg CMAKE_OPTS="${CMAKE_OPTS} ${CMAKE_EXTRA_OPTS}"
--platform ${PLATFORM}
--file ${DOCKER_FILE}
--tag ${DOCKER_IMAGE}:${DOCKER_TAG}-${ARCH} .
- docker push ${DOCKER_IMAGE}:${DOCKER_TAG}-${ARCH}
- docker push ${DOCKER_IMAGE}:${DOCKER_TAG}-${ARCH}
tags:
- docker
- $TAG
variables:
TARGET: app
parallel:
@ -200,107 +232,106 @@ pkg:docker:
- DISTRO: debian
PLATFORM: linux/amd64
ARCH: x86_64
TRIPLET: x86_64-linux-gnu
- DISTRO: debian
PLATFORM: linux/arm/v7
ARCH: armhf
TRIPLET: arm-linux-gnueabihf
DOCKER_FILE: packaging/docker/Dockerfile.debian-multiarch
TRIPLET: x86_64-linux-gnu
TAG: docker
- DISTRO: debian
PLATFORM: linux/arm64/v8
ARCH: arm64
TRIPLET: aarch64-linux-gnu
DOCKER_FILE: packaging/docker/Dockerfile.debian-multiarch
TAG: pi5
needs: []
# Stage: deploy
##############################################################################
deploy:docker:
stage: deploy
image: docker:20.10
variables:
DOCKER_CLI_EXPERIMENTAL: enabled
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker manifest create ${DOCKER_IMAGE}:${DOCKER_TAG}
${DOCKER_IMAGE}:${DOCKER_TAG}-x86_64
${DOCKER_IMAGE}:${DOCKER_TAG}-arm64
${DOCKER_IMAGE}:${DOCKER_TAG}-armhf
- docker manifest push ${DOCKER_IMAGE}:${DOCKER_TAG}
- docker manifest rm ${DOCKER_IMAGE}:${DOCKER_TAG} || true
- docker manifest create ${DOCKER_IMAGE}:${DOCKER_TAG}
${DOCKER_IMAGE}:${DOCKER_TAG}-x86_64
${DOCKER_IMAGE}:${DOCKER_TAG}-arm64
- docker manifest push ${DOCKER_IMAGE}:${DOCKER_TAG}
tags:
- docker
- docker
needs:
- job: "pkg:docker: [debian, linux/arm64/v8, arm64, aarch64-linux-gnu, packaging/docker/Dockerfile.debian-multiarch]"
- job: "pkg:docker: [debian, linux/arm/v7, armhf, arm-linux-gnueabihf, packaging/docker/Dockerfile.debian-multiarch]"
- job: "pkg:docker: [debian, linux/amd64, x86_64, x86_64-linux-gnu]"
- job: "pkg:docker: [debian, linux/amd64, x86_64, x86_64-linux-gnu, docker]"
- job: "pkg:docker: [debian, linux/arm64/v8, arm64, aarch64-linux-gnu, pi5]"
deploy:docker-dev:
stage: deploy
image: docker:20.10
variables:
DOCKER_CLI_EXPERIMENTAL: enabled
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker push ${DOCKER_IMAGE}/dev:${DOCKER_TAG}
- docker push ${DOCKER_IMAGE}/dev:${DOCKER_TAG}
tags:
- docker
- docker
needs:
- job: "prepare:docker: [fedora, --tag ${DOCKER_IMAGE}/dev:${CI_COMMIT_REF_NAME}]"
- job: "prepare:docker: [fedora, --tag ${DOCKER_IMAGE}/dev:${DOCKER_TAG}]"
deploy:docker-dev-vscode:
stage: deploy
variables:
DOCKER_CLI_EXPERIMENTAL: enabled
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker push ${DOCKER_IMAGE}/dev-vscode:${DOCKER_TAG}
tags:
- docker
needs:
- job: "prepare:docker: [fedora, dev-vscode, ${DOCKER_IMAGE}/dev-vscode]"
# Stage: latest
##############################################################################
.latest:docker:latest: &deploy_latest_docker
stage: latest
image: docker:20.10
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker manifest create ${DOCKER_IMAGE}:latest
${DOCKER_IMAGE}:${DOCKER_TAG}-x86_64
${DOCKER_IMAGE}:${DOCKER_TAG}-arm64
${DOCKER_IMAGE}:${DOCKER_TAG}-armhf
- docker manifest push ${DOCKER_IMAGE}:latest
- docker manifest rm ${DOCKER_IMAGE}:latest || true
- docker manifest create ${DOCKER_IMAGE}:latest
${DOCKER_IMAGE}:${DOCKER_TAG}-x86_64
${DOCKER_IMAGE}:${DOCKER_TAG}-arm64
- docker manifest push ${DOCKER_IMAGE}:latest
tags:
- docker
- docker
needs:
- job: deploy:docker
- job: deploy:docker
.latest:docker-dev:latest: &deploy_latest_docker_dev
stage: latest
image: docker:20.10
before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker tag ${DOCKER_IMAGE}/dev:${DOCKER_TAG} ${DOCKER_IMAGE}/dev:latest
- docker push ${DOCKER_IMAGE}/dev:latest
- docker tag ${DOCKER_IMAGE}/dev:${DOCKER_TAG} ${DOCKER_IMAGE}/dev:latest
- docker push ${DOCKER_IMAGE}/dev:latest
tags:
- docker
- docker
needs:
- job: deploy:docker-dev
- job: deploy:docker-dev
latest:docker:
<<: *deploy_latest_docker
only:
- "/^v\\d+(\\.\\d+)+$/" # Only on version tags
- "/^v\\d+(\\.\\d+)+$/" # Only on version tags
latest:docker-dev:
<<: *deploy_latest_docker_dev
only:
- "/^v\\d+(\\.\\d+)+$/" # Only on version tags
- "/^v\\d+(\\.\\d+)+$/" # Only on version tags
latest:docker:manual:
<<: *deploy_latest_docker
when: manual
except:
- "/^v\\d+(\\.\\d+)+$/" # Only on version tags
- "/^v\\d+(\\.\\d+)+$/" # Only on version tags
latest:docker-dev:manual:
<<: *deploy_latest_docker_dev
when: manual
except:
- "/^v\\d+(\\.\\d+)+$/" # Only on version tags
- "/^v\\d+(\\.\\d+)+$/" # Only on version tags

18
.gitmodules vendored
View file

@ -1,10 +1,16 @@
[submodule "common"]
path = common
url = https://github.com/VILLASframework/common.git
[submodule "fpga"]
path = fpga
url = https://github.com/VILLASframework/fpga.git
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
[submodule "packaging/live-iso/fedora-kickstarts"]
path = packaging/live-iso/fedora-kickstarts
url = https://pagure.io/fedora-kickstarts.git
[submodule "fpga/thirdparty/libxil"]
path = fpga/thirdparty/libxil
url = https://github.com/VILLASframework/libxil.git
[submodule "fpga/thirdparty/udmabuf"]
path = fpga/thirdparty/udmabuf
url = https://github.com/ikwzm/udmabuf
[submodule "fpga/lib/gpu/gdrcopy"]
path = fpga/gpu/thirdparty/gdrcopy
url = https://github.com/daniel-k/gdrcopy.git

60
.mailmap Normal file
View file

@ -0,0 +1,60 @@
# Author: Philipp Jungkamp <philipp.jungkamp@opal-rt.com>
# SPDX-FileCopyrightText: 2023 OPAL-RT Germany GmbH
# SPDX-License-Identifier: Apache-2.0
---
Anju <ameghwani@gmail.com>
Dennis Potter <dennis@dennispotter.eu>
Divya Laxetti <divya.laxetti@rwth-aachen.de>
Divya Laxetti <divyalaxetti@190-001.eduroam.rwth-aachen.de>
Divya Laxetti <laxetti.divya@gmail.com>
Eyke Liegmann <eliegmann@eonerc.rwth-aachen.de>
Felix Wege <fwege@eonerc.rwth-aachen.de>
Georg Reinke <georg.reinke@rwth-aachen.de>
Juan Pablo Noreña-Monsalve <jpnorenam@unal.edu.co>
Juan Pablo Noreña-Monsalve <34222866+jpnorenam@users.noreply.github.com>
Manuel Pitz <37443948+windrad6@users.noreply.github.com>
Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
Marija Stevic <mstevic@eonerc.rwth-aachen.de>
Markus Grigull <web@grigull.me>
Markus Mirz <mmirz@eonerc.rwth-aachen.de>
Marvin Klimke <marvin.klimke@rwth-aachen.de>
Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
Niklas Eiling <niklas.eiling@rwth-aachen.de>
Philipp Jungkamp <56401138+PJungkamp@users.noreply.github.com>
Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
Philipp Jungkamp <p.jungkamp@gmail.com>
Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
Sonja Happ <sonja.happ@eonerc.rwth-aachen.de>
Sonja Kolen <skolen@eonerc.rwth-aachen.de>
Steffen Vogel <post@steffenvogel.de>
Steffen Vogel <steffen.vogel@opal-rt.com>
Steffen Vogel <steffen.vogel@rwth-aachen.de>
Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
Umar Farooq <ufarooq@eonerc.rwth-aachen.de>
Daniel Krebs <github@daniel-krebs.net>
Iris Köster <Ikoester@eonerc.rwth-aachen.de>
Iris Köster <ikoester@eonerc.rwth-aachen.de>
Ubuntu <ubuntu@jbu-pju.osc.eonerc.rwth-aachen.de>
root <root@iepg.ws.tudelft.net>

8
.reuse/dep5 Normal file
View file

@ -0,0 +1,8 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: VILLASnode
Upstream-Contact: Steffen Vogel <post@steffenvogel.de>
Source: https://fein-aachen.org/en/projects/villas-node/
Files: *.vi *.opal *.dft *.sib *.json *.ipynb *_pb2.py doc/pictures/* doc/favicon.png clients/opal-rt/rtlab-asyncip/models/send_receive/eonerc_logo.png clients/rtds/**/*.txt clients/opal-rt/hypersim-ucm/*.ecf etc/labs/lab3.pcap packaging/live-iso/files/etc/* flake.lock tests/valgrind.supp packaging/archlinux/villas-node.install
Copyright: 2018-2023, Institute for Automation of Complex Power Systems, RWTH Aachen University
License: Apache-2.0

View file

@ -1,296 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [0.7.1] - 2019-01-23
### Fixed
- Removed most of the static storage variables from libvillas and libvillas-common
which caused crashes with DPsim.
- Fixed compilation with Ubuntu 16.04 and GCC 7.2.
- Fixed broken `shmem` node-type since addition of signal defintions.
### Changed
- Node-types can now handle more than a single file-descriptor for poll() multiplexing.
- Enable network emulation sub-system also for other node-types than `socket`.
The `rtp` node-type will support it now as well.
- Improve readabilty of log output
### Added
- Initial rate-limiting support for `rtp` node-type based on
Additive Increase / Multiplicative Decrease (AIMD) and RTCP.
## [0.7.0] - 2019-01-13
### Added
- A new sub-command `villas-relay` implements a client-to-client WebSocket relay.
It can be used as a proxy for nodes which sit behind a NAT firewall.
- New node-types: `infiniband`, `rtp`, `uldaq`
- VILLASnode got a similarily named Python package: `villas.node`.
It can be used to interact or start an VILLASnode instance.
### Changed
- The syntax of the configuration file has changed in several places.
Most node configs are now separated into `in` and `out` sections.
- We ported major parts of the VILLASnode code base to C++.
- Some of the common utilities have been moved to a new repo.
VILLAScommon is used also by other related VILLAS components.
Please make sure to checkout / update the `common/` Git sub-module.
- We build and test VILLASnode now with Fedora 29.
### Fixed
- All unit tests are running again. Most of the integration tests run again as well.
- We added support for the ARM architecture.
## [0.6.4] - 2018-07-18
### Added
- New client User Code Model (UCM) for OPAL-RT HYPERSIM digital real-time simulator
- New node-types:
- `infiniband` is using the Infiniband IBverbs and RDMA CM APIs for a low latency interface between simualation nodes.
- `comedi` adds support for ADC and DAC cards supported by the [Comedi Linux control and measurment device interface](http://comedi.org).
- All header files can now be imported into C++ code. Missing `extern "C"` declarations have been added.
### Changed
- The VILLASnode project is now built with [CMake](http://cmake.org). The old Makefile have been removed.
- The VILLASnode project will be gradually ported to C++. The tools (`/tools/`), executables (`/src/`) and plugins (`/plugins/`) have already been convert to C++ code.
## [0.6.3] - 2018-06-04
### Added
- The `csv` IO format has been splitted into a similar `tsv` IO format which uses tabulators instead of commas.
- The `struct queue_signalled` supports now synchronization under Mac OS X.
- A new `poll` setting allows the user to enable/disable the usage of `poll(2)` when reading from multiple source nodes.
### Changed
- Started splitting the node configuration into a send and receive side. This changes will be soon also reflected in a changed configuration file syntax.
- Docker images are now based on Fedora 28.
### Fixed
- We now correctly determine with terminal size when executed in GDB or by the CI runner.
## [0.6.2] - 2018-05-14
### Added
- A Docker application image can now be build in a single step using `make docker`.
### Changed
- The IO format names have changed. They now use dots (`raw.flt32`) instead of hyphens (`raw-flt32`) in their name. Please update your configuration files accordingly.
- The configuration of many node-types is now splitted into seperate `in` and `out` sections. Please update your configuration files accordingly.
## [0.6.1] - 2018-02-17
### Changed
- Rewrite of IO formatting subsystem/
### Added
- New node-types:
- `mqtt` for MQTT / Mosquitto
- A new `make help` target shows the current build configuration and available targets.
### Fixed
- Websocket node can now receive data from a "catch-all" connection and associate to the correct simulator
## [0.6.0] - 2017-12-20
### Added
- New node-types:
- `iec61850-9-2` for IEC 61850 Sampled Values
- `amqp` for AMQP / RabbitMQ
- New IO formats:
- Google `protobuf`
- Added support for Unix Domain Sockets to `socket` node-type
- Python example client using new Protobuf and UDP/Unix sockets
- Built-in hooks can be disabled now
- Network emulation has been improved
- can now load a delay distribution from the config instead from a separate file
- can emulate delay correlation
### Removed
- Moved VILLASfpga related code into external library
- `libxil` dependency is dropped
### Changed
- Packaging of Docker and RPM has been improved
- Upgraded Docker build containers to Fedora 27
- Updated submodules for most dependencies
- Use "LABEL" instead of "MAINTAINER" keyword in Dockerfiles
### Fixed
- Socket node-type supports now arbirarily sized packets
- Sample data format conversion for RAW IO formats
- Network emulation support is working again
## [0.5.1] - 2017-10-23
### Changed
- OPAL-RT AsyncIP client is only build if libopal submodule is present
### Fixed
- Build warnings and errors on Ubuntu 16.04
## [0.5.0] - 2017-10-18
### Added
- Changelog
- InfluxDB node-type
- Support for "add" / "any" path register modes
### Fixed
- Netem support is working again
### Changed
- `villas-pipe` now automatically generates correct seqeunce numbers
## [0.4.5] - 2017-09-24
### Fixed
- RPM packaging to include debug symbols in `-debuginfo` package
## [0.4.4] - 2017-09-24
### Fixed
- Invalid sequence numbers due to broken workaround
## [0.4.3] - 2017-09-24
### Changed
- Do not abort execution of socket node fails with `sendto: invalid argument`
### Fixed
- Several fixes for the mux / demux re-mapping feature
## [0.4.2] - 2017-09-19
### Fixed
- Improved stability of HTTP API
## [0.4.1] - 2017-09-16
## [0.4.0] - 2017-09-16
### Added
- API action to request status of node
- Javascript configuration example
- Pluggable IO format subsystem with plugins for:
- `csv`: Comma-separated values
- `json`: Javascript Object Notation
- `raw`: 8/16/32/64 but binary floating point and integer data
- `villas-human`: VILLAS human-readable format
- `villas-binary`: VILLAS binary wire protocol
## [0.3.5] - 2017-08-10
### Added
- API action to restart node with new configuration
- API action to terminate node
### Fixed
- VILLASnode compiles now on Ubuntu 16.04
## [0.3.4] - 2017-07-28
### Fixed
- Several compiler warnings on CLang
## [0.3.3] - 2017-07-14
### Changed
- Paths do not require output nodes anymore
### Added
- Loopback node-type
### Fixed
- OPAL-RT AsyncIP model for RT-LAB 11.1.x
## [0.3.2] - 2017-07-07
### Added
- Signal generator node-type
- Valgrind test cases
## [0.3.1] - 2017-06-29
### Added
- ZeroMQ node-type
- nanomsg node-type
- Multicast support for socket node-type
- RTDS GTNET-SKT examples
## [0.3.0] - 2017-05-08
Major changes in all parts of the software
### Added
- Pluggable node-types with plugins for:
- `file`: File / Log recording & replay
- `fpga`: VILLASfpga interface to Xilinx VC707 FPGA board via PCIexpress
- `ngsi`: FI-WARE NGSI-10 Open RESTful API for Orion Context Broker
- `websocket`: WebSocket support for VILLASweb
- `socket`: BSD network sockets
- `shmem`: POSIX shared memory
- Web-mockup for demonstration of the `websocket` node-type
### Removed
- User documentation has been moved to separate repository: http://git.rwth-aachen.de/acs/public/villas/documentation
## [0.2.0] - 2015-09-22
### Added
- OPAL-RT RT-LAB example demonstrating usage of AsyncIP
- Scripts and configuration files for creating LiveUSB Fedora images
- Travis-CI configuration
- More user documentation
## [0.1.0] - 2014-06-10
### Added
- Doxygen is now used to build documentation

View file

@ -1,9 +1,8 @@
# Main CMakeLists.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.14)
@ -54,7 +53,7 @@ include(FindSymbol)
include(CMakeDependentOption)
add_definitions(-D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE)
add_compile_options(-Wall -Wno-unknown-pragmas -Werror -fdiagnostics-color=auto)
add_compile_options(-Wall -Wno-unknown-pragmas -fdiagnostics-color=auto)
# Check OS
check_include_file("sys/eventfd.h" HAS_EVENTFD)
@ -70,12 +69,12 @@ endif()
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
find_package(OpenMP)
find_package(Opal)
find_package(IBVerbs)
find_package(RDMACM)
find_package(spdlog)
find_package(Etherlab)
find_package(Lua)
find_package(LibDataChannel)
find_package(re)
# Check for tools
find_program(PASTE NAMES paste)
@ -86,17 +85,10 @@ endif()
# Check programs
find_program(PROTOBUFC_COMPILER NAMES protoc-c)
find_program(PROTOBUF_COMPILER NAMES protoc)
find_program(GO NAMES go PATHS /usr/local/go/bin)
# Build without any GPL-code
option(WITHOUT_GPL "Build VILLASnode without any GPL code" OFF)
# Optionally download Go toolchain
option(DOWNLOAD_GO "Download Go toolchain" ON)
if(NOT GO AND DOWNLOAD_GO)
include("${CMAKE_CURRENT_LIST_DIR}/cmake/Go.cmake")
endif()
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/share/pkgconfig:/usr/lib64/pkgconfig")
pkg_check_modules(JANSSON IMPORTED_TARGET REQUIRED jansson>=2.13)
@ -105,10 +97,11 @@ pkg_check_modules(PROTOBUF IMPORTED_TARGET protobuf>=2.6.0)
pkg_check_modules(PROTOBUFC IMPORTED_TARGET libprotobuf-c>=1.1.0)
pkg_check_modules(CRITERION IMPORTED_TARGET criterion>=2.3.1)
pkg_check_modules(LIBNL3_ROUTE IMPORTED_TARGET libnl-route-3.0>=3.2.27)
pkg_check_modules(LIBIEC61850 IMPORTED_TARGET libiec61850>=1.3.1)
pkg_check_modules(LIBIEC61850 IMPORTED_TARGET libiec61850>=1.5.0)
pkg_check_modules(LIB60870 IMPORTED_TARGET lib60870>=2.3.1)
pkg_check_modules(LIBCONFIG IMPORTED_TARGET libconfig>=1.4.9)
pkg_check_modules(MOSQUITTO IMPORTED_TARGET libmosquitto>=1.6.9)
pkg_check_modules(MODBUS IMPORTED_TARGET libmodbus>=3.1.0)
pkg_check_modules(RDKAFKA IMPORTED_TARGET rdkafka>=1.5.0)
pkg_check_modules(HIREDIS IMPORTED_TARGET hiredis>=1.0.0)
pkg_check_modules(REDISPP IMPORTED_TARGET redis++>=1.2.0)
@ -124,10 +117,7 @@ pkg_check_modules(NANOMSG IMPORTED_TARGET nanomsg)
if(NOT NANOMSG_FOUND)
pkg_check_modules(NANOMSG IMPORTED_TARGET libnanomsg>=1.0.0)
endif()
pkg_check_modules(RE IMPORTED_TARGET re>=2.9.0)
if(NOT RE_FOUND)
pkg_check_modules(RE IMPORTED_TARGET libre>=0.5.6)
endif()
if (REDISPP_FOUND)
file(READ "${REDISPP_INCLUDEDIR}/sw/redis++/tls.h" CONTENTS)
@ -135,6 +125,20 @@ if (REDISPP_FOUND)
set(REDISPP_WITH_TLS ON)
endif()
unset(CONTENTS)
# Redis++ had a breaking change between 1.3.6 and 1.3.7
# Detect this change by checking if the new header exists
#
# See https://github.com/sewenew/redis-plus-plus/commit/192ebae13583ff0611e2d7666a9c1e98a2a0dc86
if (EXISTS "${REDISPP_INCLUDEDIR}/sw/redis++/redis_uri.h")
set(REDISPP_WITH_URI ON)
endif()
endif()
if (RABBITMQ_C_FOUND)
if (EXISTS "${RABBITMQ_C_INCLUDEDIR}/rabbitmq-c/amqp.h")
set(RABBITMQ_C_NEW_INCLUDE_DIR ON)
endif()
endif()
# Check if libwebsockets is build with deflate extension
@ -145,60 +149,65 @@ else()
endif()
FindSymbol(${LWS_LOCATION} lws_extension_callback_pm_deflate LWS_DEFLATE_FOUND)
# Check if VILLASfpga submodule is present
if(EXISTS "${PROJECT_SOURCE_DIR}/fpga/CMakeLists.txt")
set(FOUND_SUBMODULE_FPGA ON)
# Check if submodules for VILLASfpga are present
if(EXISTS "${PROJECT_SOURCE_DIR}/fpga/thirdparty/libxil/CMakeLists.txt")
set(FOUND_FPGA_SUBMODULES ON)
else()
set(FOUND_SUBMODULE_FPGA OFF)
set(FOUND_FPGA_SUBMODULES OFF)
endif()
# Build options
cmake_dependent_option(WITH_API "Build with remote control API" ON "" OFF)
cmake_dependent_option(WITH_CLIENTS "Build client applications" ON "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_CONFIG "Build with support for libconfig configuration syntax" ON "LIBCONFIG_FOUND" OFF)
cmake_dependent_option(WITH_DOC "Build documentation" ON "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_FPGA "Build with support for VILLASfpga" ON "FOUND_SUBMODULE_FPGA" OFF)
cmake_dependent_option(WITH_GO "Build with Go" ON "GO" OFF)
cmake_dependent_option(WITH_GRAPHVIZ "Build with Graphviz" ON "CGRAPH_FOUND; GVC_FOUND" OFF)
cmake_dependent_option(WITH_HOOKS "Build with support for processing hook plugins" ON "" OFF)
cmake_dependent_option(WITH_LUA "Build with Lua" ON "LUA_FOUND" OFF)
cmake_dependent_option(WITH_OPENMP "Build with support for OpenMP for parallel hooks" ON "OPENMP_FOUND" OFF)
cmake_dependent_option(WITH_PLUGINS "Build plugins" ON "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_SRC "Build executables" ON "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_TESTS "Run tests" ON "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_TOOLS "Build auxilary tools" ON "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_WEB "Build with internal webserver" ON "LIBWEBSOCKETS_FOUND" OFF)
cmake_dependent_option(WITH_DEFAULTS "Defaults for non required build options" ON "" OFF)
cmake_dependent_option(WITH_NODE_AMQP "Build with amqp node-type" ON "RABBITMQ_C_FOUND" OFF)
cmake_dependent_option(WITH_NODE_CAN "Build with can node-type" ON "" OFF)
cmake_dependent_option(WITH_NODE_COMEDI "Build with comedi node-type" ON "COMEDILIB_FOUND" OFF)
cmake_dependent_option(WITH_NODE_ETHERCAT "Build with ethercat node-type" ON "ETHERLAB_FOUND;NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_EXAMPLE "Build with example node-type" ON "" OFF)
cmake_dependent_option(WITH_NODE_EXEC "Build with exec node-type" ON "" OFF)
cmake_dependent_option(WITH_NODE_FILE "Build with file node-type" ON "" OFF)
cmake_dependent_option(WITH_NODE_FPGA "Build with fpga node-type" ON "WITH_FPGA" OFF)
cmake_dependent_option(WITH_NODE_GO "Build with Go nodes-types" ON "WITH_GO" OFF)
cmake_dependent_option(WITH_NODE_IEC61850 "Build with iec61850 node-types" ON "LIBIEC61850_FOUND;NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_IEC60870 "Build with iec60870 node-types" ON "LIB60870_FOUND;NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_INFINIBAND "Build with infiniband node-type" ON "IBVerbs_FOUND; RDMACM_FOUND" OFF) # Infiniband node-type is currenly broken
cmake_dependent_option(WITH_NODE_INFLUXDB "Build with influxdb node-type" ON "" OFF)
cmake_dependent_option(WITH_NODE_KAFKA "Build with kafka node-type" ON "RDKAFKA_FOUND" OFF)
cmake_dependent_option(WITH_NODE_LOOPBACK "Build with loopback node-type" ON "" OFF)
cmake_dependent_option(WITH_NODE_MQTT "Build with mqtt node-type" ON "MOSQUITTO_FOUND" OFF)
cmake_dependent_option(WITH_NODE_NANOMSG "Build with nanomsg node-type" ON "NANOMSG_FOUND" OFF)
cmake_dependent_option(WITH_NODE_NGSI "Build with ngsi node-type" ON "" OFF)
cmake_dependent_option(WITH_NODE_OPAL "Build with opal node-type" ON "Opal_FOUND" OFF)
cmake_dependent_option(WITH_NODE_REDIS "Build with redis node-type" ON "HIREDIS_FOUND; REDISPP_FOUND" OFF)
cmake_dependent_option(WITH_NODE_RTP "Build with rtp node-type" ON "RE_FOUND" OFF)
cmake_dependent_option(WITH_NODE_SHMEM "Build with shmem node-type" ON "HAS_SEMAPHORE; HAS_MMAN" OFF)
cmake_dependent_option(WITH_NODE_SIGNAL "Build with signal node-type" ON "" OFF)
cmake_dependent_option(WITH_NODE_SOCKET "Build with socket node-type" ON "LIBNL3_ROUTE_FOUND" OFF)
cmake_dependent_option(WITH_NODE_STATS "Build with stats node-type" ON "" OFF)
cmake_dependent_option(WITH_NODE_TEMPER "Build with temper node-type" ON "LIBUSB_FOUND" OFF)
cmake_dependent_option(WITH_NODE_TEST_RTT "Build with test_rtt node-type" ON "" OFF)
cmake_dependent_option(WITH_NODE_ULDAQ "Build with uldaq node-type" ON "LIBULDAQ_FOUND" OFF)
cmake_dependent_option(WITH_NODE_WEBSOCKET "Build with websocket node-type" ON "WITH_WEB; LIBWEBSOCKETS_FOUND" OFF)
cmake_dependent_option(WITH_NODE_ZEROMQ "Build with zeromq node-type" ON "LIBZMQ_FOUND;NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_API "Build with remote control API" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_CLIENTS "Build client applications" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_CONFIG "Build with support for libconfig configuration syntax" "${WITH_DEFAULTS}" "LIBCONFIG_FOUND" OFF)
cmake_dependent_option(WITH_FPGA "Build with support for VILLASfpga" "${WITH_DEFAULTS}" "FOUND_FPGA_SUBMODULES" OFF)
cmake_dependent_option(WITH_GRAPHVIZ "Build with Graphviz" "${WITH_DEFAULTS}" "CGRAPH_FOUND; GVC_FOUND" OFF)
cmake_dependent_option(WITH_HOOKS "Build with support for processing hook plugins" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_LUA "Build with Lua" "${WITH_DEFAULTS}" "LUA_FOUND" OFF)
cmake_dependent_option(WITH_OPENMP "Build with support for OpenMP for parallel hooks" "${WITH_DEFAULTS}" "OPENMP_FOUND" OFF)
cmake_dependent_option(WITH_PLUGINS "Build plugins" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_SRC "Build executables" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_TESTS "Run tests" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_TOOLS "Build auxilary tools" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
cmake_dependent_option(WITH_WEB "Build with internal webserver" "${WITH_DEFAULTS}" "LIBWEBSOCKETS_FOUND" OFF)
cmake_dependent_option(WITH_NODE_AMQP "Build with amqp node-type" "${WITH_DEFAULTS}" "RABBITMQ_C_FOUND" OFF)
cmake_dependent_option(WITH_NODE_CAN "Build with can node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_COMEDI "Build with comedi node-type" "${WITH_DEFAULTS}" "COMEDILIB_FOUND" OFF)
cmake_dependent_option(WITH_NODE_ETHERCAT "Build with ethercat node-type" "${WITH_DEFAULTS}" "ETHERLAB_FOUND; NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_EXAMPLE "Build with example node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_EXEC "Build with exec node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_FILE "Build with file node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_FPGA "Build with fpga node-type" "${WITH_DEFAULTS}" "WITH_FPGA" OFF)
cmake_dependent_option(WITH_NODE_IEC61850 "Build with iec61850 node-types" "${WITH_DEFAULTS}" "LIBIEC61850_FOUND; NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_IEC60870 "Build with iec60870 node-types" "${WITH_DEFAULTS}" "LIB60870_FOUND; NOT WITHOUT_GPL" OFF)
cmake_dependent_option(WITH_NODE_INFINIBAND "Build with infiniband node-type" "${WITH_DEFAULTS}" "IBVerbs_FOUND; RDMACM_FOUND" OFF) # Infiniband node-type is currenly broken
cmake_dependent_option(WITH_NODE_INFLUXDB "Build with influxdb node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_KAFKA "Build with kafka node-type" "${WITH_DEFAULTS}" "RDKAFKA_FOUND" OFF)
cmake_dependent_option(WITH_NODE_LOOPBACK "Build with loopback node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_MODBUS "Build with modbus node-type" "${WITH_DEFAULTS}" "MODBUS_FOUND" OFF)
cmake_dependent_option(WITH_NODE_MQTT "Build with mqtt node-type" "${WITH_DEFAULTS}" "MOSQUITTO_FOUND" OFF)
cmake_dependent_option(WITH_NODE_NANOMSG "Build with nanomsg node-type" "${WITH_DEFAULTS}" "NANOMSG_FOUND" OFF)
cmake_dependent_option(WITH_NODE_NGSI "Build with ngsi node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_REDIS "Build with redis node-type" "${WITH_DEFAULTS}" "HIREDIS_FOUND; REDISPP_FOUND" OFF)
cmake_dependent_option(WITH_NODE_RTP "Build with rtp node-type" "${WITH_DEFAULTS}" "re_FOUND" OFF)
cmake_dependent_option(WITH_NODE_SHMEM "Build with shmem node-type" "${WITH_DEFAULTS}" "HAS_SEMAPHORE; HAS_MMAN" OFF)
cmake_dependent_option(WITH_NODE_SIGNAL "Build with signal node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_SOCKET "Build with socket node-type" "${WITH_DEFAULTS}" "LIBNL3_ROUTE_FOUND" OFF)
cmake_dependent_option(WITH_NODE_STATS "Build with stats node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_TEMPER "Build with temper node-type" "${WITH_DEFAULTS}" "LIBUSB_FOUND" OFF)
cmake_dependent_option(WITH_NODE_TEST_RTT "Build with test_rtt node-type" "${WITH_DEFAULTS}" "" OFF)
cmake_dependent_option(WITH_NODE_ULDAQ "Build with uldaq node-type" "${WITH_DEFAULTS}" "LIBULDAQ_FOUND" OFF)
cmake_dependent_option(WITH_NODE_WEBRTC "Build with webrtc node-type" "${WITH_DEFAULTS}" "WITH_WEB; LibDataChannel_FOUND" OFF)
cmake_dependent_option(WITH_NODE_WEBSOCKET "Build with websocket node-type" "${WITH_DEFAULTS}" "WITH_WEB" OFF)
cmake_dependent_option(WITH_NODE_ZEROMQ "Build with zeromq node-type" "${WITH_DEFAULTS}" "LIBZMQ_FOUND; NOT WITHOUT_GPL" OFF)
# set a default for the build type
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE "Debug")
endif()
# Add more build configurations
include(cmake/config/Debug.cmake)
@ -206,6 +215,16 @@ include(cmake/config/Release.cmake)
include(cmake/config/Coverage.cmake)
include(cmake/config/Profiling.cmake)
if(NOT DEFINED VILLAS_COMPILE_WARNING_AS_ERROR)
set(VILLAS_COMPILE_WARNING_AS_ERROR ON)
endif()
if(VILLAS_COMPILE_WARNING_AS_ERROR)
add_compile_options(-Werror)
else()
add_compile_options(-Wno-error)
endif()
# Get version info and buildid from Git
GetVersion(${PROJECT_SOURCE_DIR} "CMAKE_PROJECT")
@ -213,10 +232,6 @@ if(WITH_FPGA)
add_subdirectory(fpga)
endif()
if(WITH_GO)
add_subdirectory(go)
endif()
add_subdirectory(common)
add_subdirectory(etc)
add_subdirectory(lib)
@ -235,10 +250,6 @@ if(WITH_PLUGINS)
add_subdirectory(plugins)
endif()
if(WITH_DOC AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.9.0")
add_subdirectory(doc)
endif()
if(WITH_CLIENTS)
add_subdirectory(clients)
endif()
@ -256,9 +267,7 @@ configure_file(
add_feature_info(API WITH_API "Build with remote control API")
add_feature_info(CLIENTS WITH_CLIENTS "Build client applications")
add_feature_info(CONFIG WITH_CONFIG "Build with support for libconfig configuration syntax")
add_feature_info(DOC WITH_DOC "Build documentation")
add_feature_info(FPGA WITH_FPGA "Build with FPGA support")
add_feature_info(GO WITH_GO "Build with Go code")
add_feature_info(GRAPHVIZ WITH_GRAPHVIZ "Build with Graphviz support")
add_feature_info(HOOKS WITH_HOOKS "Build with support for processing hook plugins")
add_feature_info(LUA WITH_LUA "Build with Lua support")
@ -277,17 +286,16 @@ add_feature_info(NODE_EXAMPLE WITH_NODE_EXAMPLE "Build with
add_feature_info(NODE_EXEC WITH_NODE_EXEC "Build with exec node-type")
add_feature_info(NODE_FILE WITH_NODE_FILE "Build with file node-type")
add_feature_info(NODE_FPGA WITH_NODE_FPGA "Build with fpga node-type")
add_feature_info(NODE_GO WITH_NODE_GO "Build with Go node-types")
add_feature_info(NODE_IEC61850 WITH_NODE_IEC61850 "Build with iec61850 node-types")
add_feature_info(NODE_IEC60870 WITH_NODE_IEC60870 "Build with iec60870 node-types")
add_feature_info(NODE_INFINIBAND WITH_NODE_INFINIBAND "Build with infiniband node-type")
add_feature_info(NODE_INFLUXDB WITH_NODE_INFLUXDB "Build with influxdb node-type")
add_feature_info(NODE_KAFKA WITH_NODE_KAFKA "Build with kafka node-type")
add_feature_info(NODE_LOOPBACK WITH_NODE_LOOPBACK "Build with loopback node-type")
add_feature_info(NODE_MODBUS WITH_NODE_MODBUS "Build with modbus node-type")
add_feature_info(NODE_MQTT WITH_NODE_MQTT "Build with mqtt node-type")
add_feature_info(NODE_NANOMSG WITH_NODE_NANOMSG "Build with nanomsg node-type")
add_feature_info(NODE_NGSI WITH_NODE_NGSI "Build with ngsi node-type")
add_feature_info(NODE_OPAL WITH_NODE_OPAL "Build with opal node-type")
add_feature_info(NODE_REDIS WITH_NODE_REDIS "Build with redis node-type")
add_feature_info(NODE_RTP WITH_NODE_RTP "Build with rtp node-type")
add_feature_info(NODE_SHMEM WITH_NODE_SHMEM "Build with shmem node-type")
@ -297,6 +305,7 @@ add_feature_info(NODE_STATS WITH_NODE_STATS "Build with
add_feature_info(NODE_TEMPER WITH_NODE_TEMPER "Build with temper node-type")
add_feature_info(NODE_TEST_RTT WITH_NODE_TEST_RTT "Build with test_rtt node-type")
add_feature_info(NODE_ULDAQ WITH_NODE_ULDAQ "Build with uldaq node-type")
add_feature_info(NODE_WEBRTC WITH_NODE_WEBRTC "Build with webrtc node-type")
add_feature_info(NODE_WEBSOCKET WITH_NODE_WEBSOCKET "Build with websocket node-type")
add_feature_info(NODE_ZEROMQ WITH_NODE_ZEROMQ "Build with zeromq node-type")

39
CODEOWNERS Normal file
View file

@ -0,0 +1,39 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @stv0g will be requested for
# review when someone opens a pull request.
* @stv0g
# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies the following files, only the following members
# and not the global owner(s) will be requested for a review.
# FPGA
fpga @n-eiling
/lib/nodes/fpga.cpp @n-eiling
/include/villas/nodes/fpga.hpp @n-eiling
/tools/hwdef-parse.py @n-eiling
/tools/fpga-* @n-eiling
/fpga @n-eiling
/etc/examples/nodes/fpga.conf @n-eiling
/etc/fpga @n-eiling
/doc/openapi/components/schemas/nodes/fpga.yaml @n-eiling
# PMU
/lib/nodes/libiec61850_goose.cpp @windrad6
/include/villas/nodes/libiec61850_goose.hpp @windrad6
/lib/nodes/uldaq.cpp @windrad6
/include/villas/nodes/uldaq.hpp @windrad6
/lib/dumper.cpp @windrad6
/include/villas/dumper.hpp @windrad6
# VFIO related files
/common/lib/kernel/pci.cpp @n-eiling
/common/lib/kernel/vfi_*.cpp @n-eiling
/common/include/villas/kernel/devices/* @n-eiling
/common/include/villas/kernel/vfio_*.hpp @n-eiling

View file

@ -1,176 +1,8 @@
# Contribution guidelines
## Coding style
<!--
SPDX-FileCopyrightText: 2014-2024 Institute for Automation of Complex Power Systems, RWTH Aachen University
SPDX-License-Identifier: Apache-2.0
-->
### Naming
Variables should use lower case names with underscores.
There are now special visibility or type prefixes.
Structure members should not use abbreviated names:
Good
```
struct A {
char *message;
int length;
}
```
Bad:
```
struct A {
char *msg;
int len;
}
```
### Placement of spaces
In variable declarations (including in function parameters) we place the asterisk next to the variable name.
Good:
```c
int *number;
```
Bad:
```c
int * number;
int* number;
```
In function return values we place the asterisk between spaces
Good:
```c
void * my_thread()
{
}
```
Bad:
```c
void *mythread()
{
}
void * mythread()
{
}
```
In expressions we place spaces between most elements but not between parantheses:
Good:
```
int a = ((5 * 10) + 10 ) % 22;
```
Bad:
```
int a = ((5*10)+10)%22;
```
We also put spaces infront / after most keywords such as `if`, `while`, ...
Good:
```c
for (int a = 0; a < 1; a++) {
...
}
```
Bad:
```c
for(int a = 0; a < 1; a++) {
...
}
```
### Line length
Try to limit line length to about 160 characters.
### Indention
We use tabs for indention which should be displayed as 8 spaces by your editor.
### Brace placement
For everything except functions we place the opening brace in the same line:
Good:
```c
struct A {
enum {
A,
B
} choice;
}
if (true) {
}
```
Bad:
```
struct A
{
enum
{
A,
B
} choice;
}
if (true)
{
}
```
However, in functions we place the brace in a new line:
```
void main()
{
}
```
### #define and Macro Names
Are always written UPPERCASE.
Good:
```c
#define HUGEPAGESIZE (1 << 22)
#define MAX(a, b) (a > b ? a ? b)
```
Bad:
```c
#define max(a, b) (a > b ? a ? b)
```
## Always work on feature branches
Please branch from `develop` to create a new _feature_ branch.
Please create a new _feature_ branch for every new feature or fix.
## Do not commit directly to `master` or `develop`.
Use your _feature_ branch.
Please rebase your work against the `develop` before submitting a merge reqeuest.
## Make the CI happy :-)
Only branches which pass the CI can be merged.
Visit the [contribution guidelines](https://villas.fein-aachen.org/docs/node/development/contributing/) in our documentation to understand how you can contribute to VILLASnode.

View file

@ -1,194 +0,0 @@
Apache License
==============
_Version 2.0, January 2004_
_&lt;<http://www.apache.org/licenses/>&gt;_
### Terms and Conditions for use, reproduction, and distribution
#### 1. Definitions
“License” shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
“Licensor” shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
“Legal Entity” shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, “control” means **(i)** the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
outstanding shares, or **(iii)** beneficial ownership of such entity.
“You” (or “Your”) shall mean an individual or Legal Entity exercising
permissions granted by this License.
“Source” form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
“Object” form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
“Work” shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
“Derivative Works” shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
“Contribution” shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
“submitted” means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as “Not a Contribution.”
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
#### 2. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
#### 3. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
#### 4. Redistribution
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
this License; and
* **(b)** You must cause any modified files to carry prominent notices stating that You
changed the files; and
* **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
#### 5. Submission of Contributions
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
#### 6. Trademarks
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
#### 7. Disclaimer of Warranty
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
#### 8. Limitation of Liability
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
#### 9. Accepting Warranty or Additional Liability
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
_END OF TERMS AND CONDITIONS_
### APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets `[]` replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same “printed page” as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

73
LICENSE Normal file
View file

@ -0,0 +1,73 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

73
LICENSES/Apache-2.0.txt Normal file
View file

@ -0,0 +1,73 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1,7 @@
Copyright (c) <year> <owner>. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -0,0 +1,9 @@
Copyright (c) <year> <owner>
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

11
LICENSES/BSD-3-Clause.txt Normal file
View file

@ -0,0 +1,11 @@
Copyright (c) 2017 Institute for Automation of Complex Power Systems, RWTH Aachen University.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -0,0 +1,117 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author
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 2 of the License, or (at your option) 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice

View file

@ -0,0 +1,232 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 (at your option) 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 <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.

175
LICENSES/LGPL-2.1-only.txt Normal file
View file

@ -0,0 +1,175 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the library's name and an idea of what it does.
Copyright (C) year name of author
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

10
LICENSES/Unlicense.txt Normal file
View file

@ -0,0 +1,10 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>

View file

@ -12,7 +12,7 @@ VILLASnode is a client/server application to connect simulation equipment and so
- LabView,
- and FPGA models
by using protcols such as:
by using protocols such as:
- IEEE 802.2 Ethernet / IP / UDP,
- ZeroMQ & nanomsg,
@ -29,15 +29,21 @@ VILLASnode is used in distributed- and co-simulation scenarios and developed for
## Documentation
User documentation is available here: <https://villas.fein-aachen.org/doc/node.html>
User documentation is available here: <https://villas.fein-aachen.org/docs/>
## Copyright
## Related Projects
2014-2021, Institute for Automation of Complex Power Systems, EONERC
- [MIOB](https://github.com/RWTH-ACS/miob)
- [DINO](https://github.com/RWTH-ACS/dino)
## Contributing
All contributions are welcome!
If you want to contribute to VILLASnode, please visit the [contribution guidelines](https://villas.fein-aachen.org/docs/node/development/contributing/) in our documentation.
## License
This project is released under the terms of the [Apache 2.0 license](COPYING.md).
This project is released under the terms of the [Apache 2.0 license](LICENSE).
We kindly ask all academic publications employing components of VILLASframework to cite one of the following papers:
@ -46,13 +52,22 @@ We kindly ask all academic publications employing components of VILLASframework
For other licensing options please consult [Prof. Antonello Monti](mailto:amonti@eonerc.rwth-aachen.de).
- SPDX-FileCopyrightText: 2014-2025 Institute for Automation of Complex Power Systems, RWTH Aachen University
- SPDX-FileCopyrightText: 2023-2025 OPAL-RT Germany GmbH
- SPDX-FileCopyrightText: 2022-2025 Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
- SPDX-FileCopyrightText: 2018-2025 Steffen Vogel <post@steffenvogel.de>
- SPDX-FileCopyrightText: 2018 Daniel Krebs <dkrebs@eonerc.rwth-aachen.de>
- SPDX-License-Identifier: Apache-2.0
## Contact
[![EONERC ACS Logo](doc/pictures/eonerc_logo.png)](http://www.acs.eonerc.rwth-aachen.de)
- Steffen Vogel <post@steffenvogel.de>
- Marija Stevic <mstevic@eonerc.rwth-aachen.de>
- Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
- Felix Wege <fwege@eonerc.rwth-aachen.de>
- Alexandra Bach <alexandra.bach@eonerc.rwth-aachen.de>
[Institute for Automation of Complex Power Systems (ACS)](http://www.acs.eonerc.rwth-aachen.de)
[EON Energy Research Center (EONERC)](http://www.eonerc.rwth-aachen.de)
[RWTH University Aachen, Germany](http://www.rwth-aachen.de)
[Institute for Automation of Complex Power Systems (ACS)](http://www.acs.eonerc.rwth-aachen.de)
[EON Energy Research Center (EONERC)](http://www.eonerc.rwth-aachen.de)
[RWTH University Aachen, Germany](http://www.rwth-aachen.de)

View file

@ -1,9 +1,8 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
add_subdirectory(opal)
add_subdirectory(opal-rt/rtlab-asyncip)
add_subdirectory(shmem)

View file

@ -2,3 +2,8 @@
Additional documentation about this example is available here:
https://villas.fein-aachen.org/doc/node-client-matlab.html
## License
- SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
- SPDX-License-Identifier: Apache-2.0

View file

@ -1,9 +1,9 @@
% Simple MATLAB code to receive VILLAS UDP samples
%
% @author Megha Gupta <meghagupta1191@gmail.com>
% @author Steffen Vogel <post@steffenvogel.de>
% @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
% @license Apache 2.0
% Author: Megha Gupta <meghagupta1191@gmail.com>
% Author: Steffen Vogel <post@steffenvogel.de>
% SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
% SPDX-License-Identifier: Apache-2.0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
close all;
@ -32,9 +32,9 @@ disp('Receiving data');
while i < num_samples
% Wait for connection
% Read data from the socket
[ dat, count ] = fread(t, num_values, 'float32');
data(:,i) = dat;
i = i + 1;
end

View file

@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
nodes = {
signal = {
type = "signal",

View file

@ -4,8 +4,14 @@ This directory contains a HYPERSIM user code model (UCM) for interfacing the HYP
## Documentation
Detailed information for installation and usage of the UCM is provided in the [user documentation](https://villas.fein-aachen.org/doc/node-client-hypersim.html).
Detailed information for installation and usage of the UCM is provided in the [user documentation](https://villas.fein-aachen.org/docs/node/clients/opal_hypersim).
## Author
## Authors
- Anju Meghwani <meghwani@iitk.ac.in>
- Louis Birkner <louis.birkner@opal-rt.com>
## License
- SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
- SPDX-License-Identifier: Apache-2.0

View file

@ -2,6 +2,9 @@
%% Generated from : ucm_def_file_templ_en.sh Version 1.5
%% Hypersim (Ucm) : (c) Hydro-Quebec -- 2005
%%
%% SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
%% SPDX-License-Identifier: Apache-2.0
%%
%% -----------------------------------------------------------------------------
%% Model : villas -- Fri Jun 15 12:07:11 PDT 2018
%% -----------------------------------------------------------------------------
@ -106,13 +109,12 @@ UCM_DESCRIPTION = "An interface the VILLASnode gateway"
%% BEGIN DOCUMENTATION -- Enter model's documentation after this line...
Full documentation of this model is available at:
https://villas.fein-aachen.org/doc/node-client-hypersim.html
https://villas.fein-aachen.org/docs/node/clients/opal_hypersim
Author:
## Author
## Authors
- Anju Meghwani <meghwani@iitk.ac.in>
- Louis Birkner <louis.birkner@opal-rt.com>
Anju Meghwani is a Research Establishment Officer at Indian Institute of Kanpur, India and worked in Washington State University, Pullman as visiting scholar in Summer 2018.
During her visit, she developed an interfacing framework for VILLASnode and HYPERSIM.
@ -158,7 +160,7 @@ UI-ASSIST is a joint research project between India and the US.
%% Min : Minimum value allowed.
%% Max : Maximum value allowed.
%% Flags : Ored values of flags definitions or '-'.
%% Available values :
%% Available values :
%% NOT_SIMUL_MOD : Cannot be modified during simulation.
%% Description : Short description of parameter (BETWEEN DOUBLE QUOTES)
%%
@ -190,7 +192,7 @@ UI-ASSIST is a joint research project between India and the US.
%% Fields descriptions:
%%
%% Name : Connector's unique identifier (tag).
%%
%%
%% Units : Signal's units.
%% Text field: use the official SI symbols.
%% Enter a "-" when not used
@ -216,8 +218,23 @@ UI-ASSIST is a joint research project between India and the US.
switchr no int in auto S "Receive Data"
switchs no int in auto S "Send Data"
datain no double in auto I "Data Input"
dataout no double out auto O "Data Output"
datain0 no double in auto I "Data Input 0"
datain1 no double in auto I "Data Input 1"
datain2 no double in auto I "Data Input 2"
datain3 no double in auto I "Data Input 3"
datain4 no double in auto I "Data Input 4"
datain5 no double in auto I "Data Input 5"
datain6 no double in auto I "Data Input 6"
datain7 no double in auto I "Data Input 7"
dataout0 no double out auto O "Data Output 0"
dataout1 no double out auto O "Data Output 1"
dataout2 no double out auto O "Data Output 2"
dataout3 no double out auto O "Data Output 3"
dataout4 no double out auto O "Data Output 4"
dataout5 no double out auto O "Data Output 5"
dataout6 no double out auto O "Data Output 6"
dataout7 no double out auto O "Data Output 7"
%% END CONTROL IOS
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -233,7 +250,7 @@ dataout no double out auto O "Data Output"
%% Fields descriptions:
%%
%% Name : Node's unique identifier.
%%
%%
%% Phases : Number of phases.
%% Text field: Enter a number (1, 3) or
%% 0 for dynamic number of phases.
@ -398,13 +415,13 @@ dataout no double out auto O "Data Output"
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATORY INCLUDES PATHS LIST -- Modify the following list...
UCM_PREP_INCLUDES_PATHS =
UCM_PREP_INCLUDES_PATHS =
%% END PREPARATORY INCLUDES PATHS LIST
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
%% 8.5- Required dependency libraries pathnames list.
%%
%%
%% Enter the pathnames of your dependency libraries
%% separated by spaces after "=".
%% Put an "\" at end of line to continue list on next line.
@ -434,7 +451,7 @@ UCM_PREP_INCLUDES_PATHS =
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATORY DEPENDANT LIBRARIES LIST -- Modify the following list...
UCM_PREP_DEP_LIBS_PATHNAMES =
UCM_PREP_DEP_LIBS_PATHNAMES =
%% END PREPARATORY DEPENDANT LIBRARIES LIST
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -449,7 +466,7 @@ UCM_PREP_DEP_LIBS_PATHNAMES =
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN PREPARATORY LIBRARIES LIST -- Modify the following list...
UCM_PREP_LIBRARIES =
UCM_PREP_LIBRARIES =
%% END PREPARATORY LIBRARIES LIST
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -524,7 +541,8 @@ UCM_PREP_LIBRARIES =
#define REMOTE_ADR "192.168.1.188"
#define MAX_VALUES 64
#define NO_SEND_DATA 3
#define NO_SEND_DATA 8
#define NO_RECV_DATA 8
/***** User Settings End ******/
@ -627,9 +645,9 @@ struct sockaddr_in rec_addr;
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN SIMULATION INITIALIZATION FUNCTION CODE -- Enter code ->...
int ret;
unsigned int yes = 1;
unsigned int yes = 1;
if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0 ) {
perror("socket creation failed");
@ -640,7 +658,7 @@ struct sockaddr_in rec_addr;
perror("socket creation failed");
exit(EXIT_FAILURE);
}
memset(&rec_addr, 0, sizeof(rec_addr));
rec_addr.sin_family = AF_INET; // IPv4
rec_addr.sin_addr.s_addr = htonl(INADDR_ANY);
@ -651,12 +669,12 @@ struct sockaddr_in rec_addr;
send_addr.sin_addr.s_addr = inet_addr(REMOTE_ADR);
send_addr.sin_port = htons(PORT);
if (bind(sockfd, (struct sockaddr*)&rec_addr, sizeof(struct sockaddr_in)) < 0)
if (bind(sockfd, (struct sockaddr*)&rec_addr, sizeof(struct sockaddr_in)) < 0)
fprintf(stdout,"ERROR DETECTED !!! There is a problem in binding");
if (connect(sockfds, (struct sockaddr*)&send_addr, sizeof(struct sockaddr_in)) < 0)
if (connect(sockfds, (struct sockaddr*)&send_addr, sizeof(struct sockaddr_in)) < 0)
fprintf(stdout,"ERROR DETECTED !!! There is a problem in connecting");
#if 0
// Join a multicast group
struct ip_mreq mreq;
@ -684,7 +702,7 @@ struct sockaddr_in rec_addr;
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN BEFORE VOLTAGE CALCULATION CODE -- Enter code ->...
%% END BEFORE VOLTAGE CALCULATION CODE
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%%
@ -693,9 +711,9 @@ struct sockaddr_in rec_addr;
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN AFTER VOLTAGE CALCULATION -- Enter code ->...
int ret;
/* Receiving data */
char bufr[MSG_LEN(MAX_VALUES)];
struct msg *msgr = (struct msg *) bufr;
@ -703,23 +721,40 @@ struct sockaddr_in rec_addr;
struct sockaddr_in cli_addr;
int cli_addrlen = sizeof(cli_addr);
if (switchr == 1) {
if (switchr == 1) {
memset(&cli_addr, 0, sizeof(cli_addr));
memset((char *) msgr, 0, sizeof(bufr));
ret = recvfrom(sockfd, (char *) msgr, sizeof(bufr), 0, (struct sockaddr *) &cli_addr, &cli_addrlen);
msgr->length = htons(msgr->length);
msgr->sequence = htonl(msgr->sequence);
msgr->ts.sec = htonl(msgr->ts.sec);
msgr->ts.nsec = htonl(msgr->ts.nsec);
msgr->data[0].i = ntohl(msgr->data[0].i);
dataout = (float) msgr->data[0].f;
if (msgr->length >= NO_RECV_DATA) {
msgr->data[0].i = ntohl(msgr->data[0].i);
msgr->data[1].i = ntohl(msgr->data[1].i);
msgr->data[2].i = ntohl(msgr->data[2].i);
msgr->data[3].i = ntohl(msgr->data[3].i);
msgr->data[4].i = ntohl(msgr->data[4].i);
msgr->data[5].i = ntohl(msgr->data[5].i);
msgr->data[6].i = ntohl(msgr->data[6].i);
msgr->data[7].i = ntohl(msgr->data[7].i);
dataout0 = (float) msgr->data[0].f;
dataout1 = (float) msgr->data[1].f;
dataout2 = (float) msgr->data[2].f;
dataout3 = (float) msgr->data[3].f;
dataout4 = (float) msgr->data[4].f;
dataout5 = (float) msgr->data[5].f;
dataout6 = (float) msgr->data[6].f;
dataout7 = (float) msgr->data[7].f;
}
}
/* Sending data */
char buf[MSG_LEN(MAX_VALUES)];
char buf[MSG_LEN(NO_SEND_DATA)];
struct msg *msg = (struct msg *) buf;
struct timespec now;
@ -737,14 +772,29 @@ struct sockaddr_in rec_addr;
msg->ts.sec = now.tv_sec;
msg->ts.nsec = now.tv_nsec;
msg->data[0].f = datain;
msg->data[0].f = datain0;
msg->data[1].f = datain1;
msg->data[2].f = datain2;
msg->data[3].f = datain3;
msg->data[3].f = datain3;
msg->data[4].f = datain4;
msg->data[5].f = datain5;
msg->data[6].f = datain6;
msg->data[0].i = htonl(msg->data[0].i);
msg->data[1].i = htonl(msg->data[1].i);
msg->data[2].i = htonl(msg->data[2].i);
msg->data[3].i = htonl(msg->data[3].i);
msg->data[4].i = htonl(msg->data[4].i);
msg->data[5].i = htonl(msg->data[5].i);
msg->data[6].i = htonl(msg->data[6].i);
msg->data[7].i = htonl(msg->data[7].i);
msg->length = htons(msg->length);
msg->sequence = htonl(msg->sequence);
msg->ts.sec = htonl(msg->ts.sec);
msg->ts.nsec = htonl(msg->ts.nsec);
ret = sendto(sockfds, (char *) msg, MSG_LEN(NO_SEND_DATA), 0, (struct sockaddr *) &send_addr, sizeof(send_addr));
}
@ -758,7 +808,7 @@ struct sockaddr_in rec_addr;
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN SIMULATION INCLUDES PATHS LIST -- Modify the following list...
UCM_SIMULATION_INCLUDES_PATHS =
UCM_SIMULATION_INCLUDES_PATHS =
%% END SIMULATION INCLUDES PATHS LIST
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -773,7 +823,7 @@ UCM_SIMULATION_INCLUDES_PATHS =
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN SIMULATION DEP LIBS LIST -- Modify the following list...
UCM_SIMULATION_DEP_LIBS_PATHNAMES =
UCM_SIMULATION_DEP_LIBS_PATHNAMES =
%% END SIMULATION DEP LIBS LIST
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -785,20 +835,20 @@ UCM_SIMULATION_DEP_LIBS_PATHNAMES =
%%
%% ARCHITECTURE DEPENDANT PATHS: See NOTE in section 8.5
%%
%% UCM_SIMULATION_LIBRARIES_<ARCH>: use for compiler dependant librairies
%% UCM_SIMULATION_LIBRARIES_<ARCH>: use for compiler dependant librairies
%%
%%vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
%% BEGIN SIMULATION LIBRARIES LIST -- Modify the following list...
UCM_SIMULATION_LIBRARIES =
UCM_SIMULATION_LIBRARIES_WINDOWS =
UCM_SIMULATION_LIBRARIES_LINUX_RHEL5_32 =
UCM_SIMULATION_LIBRARIES_LINUX_RHEL6_64 =
UCM_SIMULATION_LIBRARIES_LINUX_SLES9_ia64 =
UCM_SIMULATION_LIBRARIES_LINUX_SLES10_ia64 =
UCM_SIMULATION_LIBRARIES_LINUX_SLES11SP1_x86_64 =
UCM_SIMULATION_LIBRARIES_LINUX_SLES11SP3_x86_64 =
UCM_SIMULATION_LIBRARIES_LINUX_SLES12SP1_x86_64 =
UCM_SIMULATION_LIBRARIES =
UCM_SIMULATION_LIBRARIES_WINDOWS =
UCM_SIMULATION_LIBRARIES_LINUX_RHEL5_32 =
UCM_SIMULATION_LIBRARIES_LINUX_RHEL6_64 =
UCM_SIMULATION_LIBRARIES_LINUX_SLES9_ia64 =
UCM_SIMULATION_LIBRARIES_LINUX_SLES10_ia64 =
UCM_SIMULATION_LIBRARIES_LINUX_SLES11SP1_x86_64 =
UCM_SIMULATION_LIBRARIES_LINUX_SLES11SP3_x86_64 =
UCM_SIMULATION_LIBRARIES_LINUX_SLES12SP1_x86_64 =
%% END SIMULATION LIBRARIES LIST
%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -0,0 +1,4 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
*.log

View file

@ -10,3 +10,7 @@
<nature>com.opalrt.rtlab.ui.rtlabnature</nature>
</natures>
</projectDescription>
<!--
SPDX-FileCopyrightText: 2014-2022 Institute for Automation of Complex Power Systems, EONERC
SPDX-License-Identifier: Apache-2.0
-->

View file

@ -1,9 +1,8 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
if(OPAL_FOUND)
# Just call the original Makefile

View file

@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
*.o
*.d
AsyncIP
Opcommon/
report/
*_sm_model/
*_ss_model/
*_sc_console.mdl

View file

@ -0,0 +1,66 @@
# Makefile.
#
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
# Specify program name
PROGRAM = AsyncIP
TARGET_RTLAB_ROOT ?= /usr/opalrt
RTLAB_ROOT = $(TARGET_RTLAB_ROOT)
# Intel is the default compiler
RTLAB_INTEL_COMPILER ?= 0
ifeq ($(RTLAB_INTEL_COMPILER),1)
CC = opicc
else
CC = gcc
endif
LIB_TARGET = -lpthread -lrt -lm
# Add Intel C library for compilation with gcc
ifeq ($(RTLAB_INTEL_COMPILER),0)
LIB_TARGET += -lirc -ldl
else
LD_OPTS += -diag-disable remark,warn
endif
LD := $(CC)
CC_OPTS = -std=c99 -D_GNU_SOURCE -MMD
LD_OPTS =
OBJS = main.o msg.o utils.o socket.o
ifeq ($(DEBUG),1)
CC_OPTS += -g -D_DEBUG
LD_OPTS += -g
else
CC_OPTS += -O
endif
ifneq ($(PROTOCOL),)
CC_OPTS += -DPROTOCOL=$(PROTOCOL)
endif
INCPATH = -I. -I$(RTLAB_ROOT)/common/include_target
LIBPATH = -L. $(OPAL_LIBPATH)
# The required libraries are transfered automatically in the model directory before compilation
LIBS := -lOpalAsyncApiCore -lOpalCore -lOpalUtils $(OPAL_LIBS) $(LIB_TARGET)
CFLAGS = $(CC_OPTS) $(INCPATH)
LDFLAGS = $(LD_OPTS) $(LIBPATH)
all: $(PROGRAM)
install:
\mkdir -p $(RTLAB_ROOT)/local
\chmod 755 $(RTLAB_ROOT/local
\cp -f $(PROGRAM) $(RTLAB_ROOT)/local
clean:
\rm -f $(OBJS) $(PROGRAM)
$(PROGRAM): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) -Wl,--start-group $(LIBS) -Wl,--end-group

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -0,0 +1,25 @@
/* Compile-time configuration.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _CONFIG_H_
#define _CONFIG_H_
#define PROGNAME "VILLASnode-OPAL-UDP"
#define VERSION "0.7"
#define MAX_VALUES 64
// List of protocols
#define VILLAS 1
#define GTNET_SKT 2
// Default protocol
#ifndef PROTOCOL
#define PROTOCOL VILLAS
#endif // PROTOCOL
#endif // _CONFIG_H_

View file

@ -1,17 +1,16 @@
/** Message related functions
/* Message related functions.
*
* @file
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
/* Forward declarations. */
// Forward declarations
struct msg;
/** Swaps the byte-order of the message.
/* Swaps the byte-order of the message.
*
* Message are always transmitted in network (big endian) byte order.
*
@ -25,7 +24,7 @@ void msg_ntoh(struct msg *m);
void msg_hton(struct msg *m);
/** Check the consistency of a message.
/* Check the consistency of a message.
*
* The functions checks the header fields of a message.
*

View file

@ -0,0 +1,72 @@
/* Message format.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
// The current version number for the message format
#define MSG_VERSION 2
// TODO: Implement more message types
#define MSG_TYPE_DATA 0 // Message contains float values
#define MSG_TYPE_START 1 // Message marks the beginning of a new simulation case
#define MSG_TYPE_STOP 2 // Message marks the end of a simulation case
// The total size in bytes of a message
#define MSG_LEN(values) (sizeof(struct msg) + MSG_DATA_LEN(values))
// The length of \p values values in bytes
#define MSG_DATA_LEN(values) (sizeof(float) * (values))
// The offset to the first data value in a message
#define MSG_DATA_OFFSET(msg) ((char *)(msg) + offsetof(struct msg, data))
// Initialize a message with default values
#define MSG_INIT(len, seq) \
(struct msg) { \
.version = MSG_VERSION, .type = MSG_TYPE_DATA, .length = len, \
.sequence = seq, .id = 0 \
}
// The timestamp of a message in struct timespec format
#define MSG_TS(msg) \
(struct timespec) { .tv_sec = (msg)->ts.sec, .tv_nsec = (msg)->ts.nsec }
// This message format is used by all clients
struct msg {
#if BYTE_ORDER == BIG_ENDIAN
unsigned
version : 4; // Specifies the format of the remaining message (see MGS_VERSION)
unsigned type : 2; // Data or control message (see MSG_TYPE_*)
unsigned reserved1 : 2; // Reserved bits
#elif BYTE_ORDER == LITTLE_ENDIAN
unsigned reserved1 : 2; // Reserved bits
unsigned type : 2; // Data or control message (see MSG_TYPE_*)
unsigned
version : 4; // Specifies the format of the remaining message (see MGS_VERSION)
#else
#error Invalid byte-order
#endif // BYTEORDER
uint8_t id; // An id which identifies the source of this sample
uint16_t length; // The number of values in msg::data[]
uint32_t
sequence; // The sequence number is incremented by one for consecutive messages
// A timestamp per message
struct {
uint32_t sec; // Seconds since 1970-01-01 00:00:00
uint32_t nsec; // Nanoseconds of the current second
} ts;
// The message payload
union {
float f; // Floating point values
uint32_t i; // Integer values
} data[];
} __attribute__((packed));

View file

@ -0,0 +1,33 @@
/* Helper functions for sockets.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _SOCKET_H_
#define _SOCKET_H_
#include <netinet/in.h>
#define RT
#include "OpalGenAsyncParamCtrl.h"
#define UDP_PROTOCOL 1
#define TCP_PROTOCOL 2
struct socket {
struct sockaddr_in send_ad; // Send address
struct sockaddr_in recv_ad; // Receive address
int sd; // socket descriptor
};
int socket_init(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct);
int socket_send(struct socket *s, char *data, int len);
int socket_recv(struct socket *s, char *data, int len, double timeout);
int socket_close(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct);
#endif // _SOCKET_H_

View file

@ -0,0 +1,15 @@
/* Configure scheduler.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* Author: Mathieu Dubé-Dallaire
* SPDX-FileCopyrightText: 2003 OPAL-RT Technologies inc
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _UTILS_H_
#define _UTILS_H_
int AssignProcToCpu0(void);
#endif // _UTILS_H_

View file

@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
[EnvVars]
ABORT_COMPILE_WHEN_NO_BITSTREAM=0
ACTION_AFTER_N_OVERRUNS=10
@ -24,8 +26,8 @@ MSG_PRECISION_FACTOR=0
MaxDynamicSignals=2/0/100/24/44/
NB_STEP_WITHOUT_OVERRUNS=10
OPAL_DEBUG=OFF
OP_MATLABR2014B=1
OS_COMPILE_RELEASE=2.6.29.6-opalrt-5
OP_MATLABR2021B=1
OS_COMPILE_RELEASE=OPAL-RTLinux 3.5.4 (4.19.80)
PRINT_LOG_LEVEL=DEBUG_RUN
RESET_IO_MISSING=ON
SYSNAME=linux
@ -36,42 +38,34 @@ WATCHDOG_TIMEOUT=5000
INTERNAL_IGN_SOURCE_FILE=sfun_gen_async_ctrl.c sfun_recv_async.c sfun_send_async.c
INTERNAL_LIBRARY2=-lOpalAsyncApiR2014b
INTERNAL_LIBRARY3=-lOpalAsyncApiCore
[ExtraPutFilesComp]
Makefile.mk=Ascii
include\config.h=Ascii
include\msg.h=Ascii
include\msg_format.h=Ascii
include\socket.h=Ascii
include\utils.h=Ascii
src\compat.c=Ascii
src\main.c=Ascii
src\msg.c=Ascii
src\socket.c=Ascii
src\utils.c=Ascii
[General]
ATT_CHECKSUM1=2360032266
ATT_CHECKSUM2=1041833943
ATT_CHECKSUM3=842695092
ATT_CHECKSUM4=2435976698
ATT_CHECKSUM1=4135475928
ATT_CHECKSUM2=3941568524
ATT_CHECKSUM3=2861311461
ATT_CHECKSUM4=1582866546
ATT_CREATED_BY=jwu
ATT_CREATED_ON=Thu Apr 15 08:21:54 1999
ATT_ENABLE_PTA=OFF
ATT_HANDLE_CONSOLE=ON
ATT_LAST_SAVED_BY=svo
ATT_LAST_SAVED_ON=Thu Jun 29 20:16:22 2017
ATT_LAST_SAVED_BY=SteffenVogel
ATT_LAST_SAVED_ON=Thu Oct 31 12:47:23 2024
ATT_REFERENCE_MDL_PATHS=
ATT_REVISION=1.454
ATT_REVISION=15.0
AutoRetrieveFiles=ON
AutoRetrieveRtlab=ON
CompilerVersion=AUTOMATIC
DESCRIPTION=
DinamoFlag=OFF
FILENAME=C:\Users\svo\workspace\villas\node\clients\opal\models\send_receive\send_receive.mdl
EXATACPS_AUTORUN=FALSE
EXATACPS_AUTOSTOP=FALSE
EXATACPS_EXE=
EXATACPS_SCENARIO=::json::
FILENAME=C:\Git\external\villas\node\clients\opal\models\send_receive\send_receive.mdl
FORCE_RECOMPILE=0
IMPORTED_GLOBAL_VARIABLES=1
LastCompileRtlabVersion=v11.0.8.13
LastMatlabUsed=27
LastMatlabUsedName=v8.4
LastCompileRtlabVersion=v2024.3.2.48
LastMatlabUsed=169
LastMatlabUsedName=v9.11
MATLAB_USED_IN_MODEL=21
Name=send_receive
PETALINUX_LAST_COMPILE_VERSION=
@ -79,7 +73,7 @@ PRINT_CYCLE=OFF
PostBuildCmd=
PreBuildCmd=
QNX_LAST_COMPILE_VERSION=
RH64_LAST_COMPILE_VERSION=
RH64_LAST_COMPILE_VERSION=OPAL-RTLinux 3.5.4 (4.19.80)
RH_LAST_COMPILE_VERSION=2.6.29.6-opalrt-5
ReportFileId=
RetrieveBuildTree=ON
@ -87,18 +81,16 @@ RetrieveRootDir=
SimulationMode=2
TLC=Automatic
TMF=Automatic
TRANSFERFILE_AT_LOAD=OFF
TRANSFERFILE_AT_LOAD=ON
TargetCompileCmd=/usr/bin/make -f /usr/opalrt/common/bin/opalmodelmk
TargetPlatform=REDHAWK
TargetPlatform=REDHAWK64
TimeFactor=1.000000000000000
TimeStep=0.000050000000000
sc_consoleTimeStep=-1.000000000000000
sm_modelTimeStep=0.000049999998737
sm_send_receiveTimeStep=0.000049999998737
[General_1]
TargetPreCompileCmd=make -f /usr/opalrt/common/bin/opalmodelmk
[NodeMapping]
sm_model=ACS_OPAL_RT
sm_model=opalrtlinux
sm_model_CORE_ASSIGNATION=1
sm_model_CPU=-1
sm_model_DEBUG=OFF
@ -110,4 +102,25 @@ sm_send_receive_DEBUG=OFF
sm_send_receive_XHP_ENABLE=FALSE
[UserEnvVars]
PROTOCOL=VILLAS
RTLAB_INTEL_COMPILER=1
[ExtraPutFilesComp]
AsyncIP.mk=Ascii
include\config.h=Ascii
include\msg.h=Ascii
include\msg_format.h=Ascii
include\socket.h=Ascii
include\utils.h=Ascii
src\compat.c=Ascii
src\main.c=Ascii
src\msg.c=Ascii
src\socket.c=Ascii
src\utils.c=Ascii
[ExtraGetFilesComp_1_RT_LAB]
AsyncIP=Binary|Async_Proc
[ExtraPutFilesLoad_1_RT_LAB]
.\send_receive_sm_model\OpREDHAWK64target\AsyncIP=Binary|Async_Proc
[EnvVars_REDHAWK64_DYN_1]
INTERNAL_IGN_SOURCE_FILE=sfun_gen_async_ctrl.c sfun_recv_async.c sfun_send_async.c
INTERNAL_LIBRARY2=-lOpalAsyncApiR2021B
INTERNAL_LIBRARY3=-lOpalAsyncApiCore
[General_1]
TargetPreCompileCmd=make -f /usr/opalrt/common/bin/opalmodelmk

View file

@ -1,4 +1,6 @@
# $Revision: 1.1 $
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
Model {
Name "send_receive"
Version 8.4

View file

@ -1,3 +1,5 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
[General]
ATT_VERSION=6
FileVersion=6
@ -17,8 +19,12 @@ numValues=200
offset=0
rearmDelay=0.000000
repetitive=1
signalId=0
signalIndex=0
signalName=
signalNameId=0
trigSigId=0
trigSigIndex=0
trigSigNameId=339755367
trigSignalName=
trigType=0
@ -43,8 +49,12 @@ numValues=100
offset=0
rearmDelay=0.000000
repetitive=1
signalId=0
signalIndex=0
signalName=
signalNameId=1818584175
trigSigId=0
trigSigIndex=0
trigSigNameId=1866690149
trigSignalName=
trigType=0

View file

@ -0,0 +1,362 @@
/* Main routine of AsyncIP.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
// Standard ANSI C headers needed for this program
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
/* Define RTLAB before including OpalPrint.h for messages to be sent
* to the OpalDisplay. Otherwise stdout will be used. */
#define RTLAB
#include "AsyncApi.h"
#include "OpalPrint.h"
// This is the message format
#include "config.h"
#include "socket.h"
#include "utils.h"
#if PROTOCOL == VILLAS
#include "msg.h"
#include "msg_format.h"
#endif
/* This is just for initializing the shared memory access to communicate
* with the RT-LAB model. It's easier to remember the arguments like this */
#define ASYNC_SHMEM_NAME argv[1]
#define ASYNC_SHMEM_SIZE atoi(argv[2])
#define PRINT_SHMEM_NAME argv[3]
// Global Variables
struct socket skt;
static void *SendToIPPort(void *arg) {
unsigned int ModelState, SendID, Sequence = 0;
int nbSend = 0, ret, cnt, len;
// Data from OPAL-RT model
double mdldata[MAX_VALUES];
int mdldata_size;
#if PROTOCOL == VILLAS
char buf[MSG_LEN(MAX_VALUES)];
struct msg *msg = (struct msg *)buf;
#elif PROTOCOL == GTNET_SKT
char buf[MAX_VALUES * sizeof(float)];
float *msg = (float *)buf;
#endif
OpalPrint("%s: SendToIPPort thread started\n", PROGNAME);
OpalGetNbAsyncSendIcon(&nbSend);
if (nbSend < 1) {
OpalPrint("%s: SendToIPPort: No transimission block for this controller. "
"Stopping thread.\n",
PROGNAME);
return NULL;
}
do {
// This call unblocks when the 'Data Ready' line of a send icon is asserted.
ret = OpalWaitForAsyncSendRequest(&SendID);
if (ret != EOK) {
ModelState = OpalGetAsyncModelState();
if ((ModelState != STATE_RESET) && (ModelState != STATE_STOP)) {
OpalSetAsyncSendIconError(ret, SendID);
OpalPrint("%s: OpalWaitForAsyncSendRequest(), errno %d\n", PROGNAME,
ret);
}
continue;
}
// No errors encountered yet
OpalSetAsyncSendIconError(0, SendID);
// Get the size of the data being sent by the unblocking SendID
OpalGetAsyncSendIconDataLength(&mdldata_size, SendID);
cnt = mdldata_size / sizeof(double);
if (cnt > MAX_VALUES) {
OpalPrint("%s: Number of signals for SendID=%d exceeds allowed maximum "
"(%d). Limiting...\n",
PROGNAME, SendID, MAX_VALUES);
cnt = MAX_VALUES;
}
// Read data from the model
OpalGetAsyncSendIconData(mdldata, mdldata_size, SendID);
#if PROTOCOL == VILLAS
// Get current time
struct timespec now;
clock_gettime(CLOCK_REALTIME, &now);
msg->version = MSG_VERSION;
msg->type = MSG_TYPE_DATA;
msg->reserved1 = 0;
msg->id = SendID;
msg->length = cnt;
msg->sequence = Sequence++;
msg->ts.sec = now.tv_sec;
msg->ts.nsec = now.tv_nsec;
for (int i = 0; i < msg->length; i++)
msg->data[i].f = (float)mdldata[i];
len = MSG_LEN(msg->length);
msg_hton(msg);
#elif PROTOCOL == GTNET_SKT
uint32_t *imsg = (uint32_t *)msg;
for (int i = 0; i < cnt; i++) {
msg[i] = (float)mdldata[i];
imsg[i] = htonl(imsg[i]);
}
len = cnt * sizeof(float);
#else
#error Unknown protocol
#endif
// Perform the actual write to the ip port
ret = socket_send(&skt, (char *)msg, len);
if (ret < 0)
OpalSetAsyncSendIconError(errno, SendID);
else
OpalSetAsyncSendIconError(0, SendID);
/* This next call allows the execution of the "asynchronous" process
* to actually be synchronous with the model. To achieve this, you
* should set the "Sending Mode" in the Async_Send block to
* NEED_REPLY_BEFORE_NEXT_SEND or NEED_REPLY_NOW. This will force
* the model to wait for this process to call this
* OpalAsyncSendRequestDone function before continuing. */
OpalAsyncSendRequestDone(SendID);
/* Before continuing, we make sure that the real-time model
* has not been stopped. If it has, we quit. */
ModelState = OpalGetAsyncModelState();
} while ((ModelState != STATE_RESET) && (ModelState != STATE_STOP));
OpalPrint("%s: SendToIPPort: Finished\n", PROGNAME);
return NULL;
}
static void *RecvFromIPPort(void *arg) {
unsigned int ModelState, RecvID;
int nbRecv = 0, ret, cnt;
// Data from OPAL-RT model
double mdldata[MAX_VALUES];
int mdldata_size;
#if PROTOCOL == VILLAS
char buf[MSG_LEN(MAX_VALUES)];
struct msg *msg = (struct msg *)buf;
#elif PROTOCOL == GTNET_SKT
char buf[MAX_VALUES * sizeof(float)];
float *msg = (float *)buf;
#else
#error Unknown protocol
#endif
OpalPrint("%s: RecvFromIPPort thread started\n", PROGNAME);
OpalGetNbAsyncRecvIcon(&nbRecv);
if (nbRecv < 1) {
OpalPrint("%s: RecvFromIPPort: No reception block for this controller. "
"Stopping thread.\n",
PROGNAME);
return NULL;
}
// Get list of RecvIds
unsigned int RecvIDs[nbRecv];
ret = OpalGetAsyncRecvIDList(RecvIDs, sizeof(RecvIDs));
if (ret != EOK) {
OpalPrint("%s: Failed to get list of RecvIDs\n", PROGNAME);
return NULL;
}
do {
// Receive message
ret = socket_recv(&skt, (char *)msg, sizeof(buf), 1.0);
if (ret < 1) {
ModelState = OpalGetAsyncModelState();
if ((ModelState != STATE_RESET) && (ModelState != STATE_STOP)) {
if (ret == 0) // timeout, so we continue silently
OpalPrint("%s: Timeout while waiting for data\n", PROGNAME, errno);
if (ret == -1) // a more serious error, so we print it
OpalPrint("%s: Error %d while waiting for data\n", PROGNAME, errno);
continue;
}
break;
}
#if PROTOCOL == VILLAS
RecvID = msg->id;
#elif PROTOCOL == GTNET_SKT
RecvID = 1;
#else
#error Unknown protocol
#endif
// Check if this RecvID exists
for (int i = 0; i < nbRecv; i++) {
if (RecvIDs[i] == RecvID)
goto found;
}
OpalPrint("%s: Received message with non-existent RecvID=%d. Changing to "
"RecvID=%d...\n",
PROGNAME, RecvID, RecvIDs[0]);
RecvID = RecvIDs[0];
found: // Get the number of signals to send back to the model
OpalGetAsyncRecvIconDataLength(&mdldata_size, RecvID);
cnt = mdldata_size / sizeof(double);
if (cnt > MAX_VALUES) {
OpalPrint("%s: Number of signals for RecvID=%d (%d) exceeds allowed "
"maximum (%d)\n",
PROGNAME, RecvID, cnt, MAX_VALUES);
return NULL;
}
#if PROTOCOL == VILLAS
msg_ntoh(msg);
ret = msg_verify(msg);
if (ret) {
OpalPrint("%s: Skipping invalid packet\n", PROGNAME);
continue;
}
if (cnt > msg->length) {
OpalPrint("%s: Number of signals for RecvID=%d (%d) exceeds what was "
"received (%d)\n",
PROGNAME, RecvID, cnt, msg->length);
}
for (int i = 0; i < msg->length; i++)
mdldata[i] = (double)msg->data[i].f;
// Update OPAL model
OpalSetAsyncRecvIconStatus(msg->sequence,
RecvID); // Set the Status to the message ID
#elif PROTOCOL == GTNET_SKT
uint32_t *imsg = (uint32_t *)msg;
for (int i = 0; i < cnt; i++) {
imsg[i] = ntohl(imsg[i]);
mdldata[i] = (double)msg[i];
}
#else
#error Unknown protocol
#endif
OpalSetAsyncRecvIconError(0, RecvID); // Set the Error to 0
OpalSetAsyncRecvIconData(mdldata, mdldata_size, RecvID);
/* Before continuing, we make sure that the real-time model
* has not been stopped. If it has, we quit. */
ModelState = OpalGetAsyncModelState();
} while ((ModelState != STATE_RESET) && (ModelState != STATE_STOP));
OpalPrint("%s: RecvFromIPPort: Finished\n", PROGNAME);
return NULL;
}
int main(int argc, char *argv[]) {
int ret;
Opal_GenAsyncParam_Ctrl IconCtrlStruct;
pthread_t tid_send, tid_recv;
OpalPrint("%s: This is %s client version %s\n", PROGNAME, PROGNAME, VERSION);
// Check for the proper arguments to the program
if (argc < 4) {
printf("Invalid Arguments: 1-AsyncShmemName 2-AsyncShmemSize "
"3-PrintShmemName\n");
exit(0);
}
// Enable the OpalPrint function. This prints to the OpalDisplay.
ret = OpalSystemCtrl_Register(PRINT_SHMEM_NAME);
if (ret != EOK) {
printf("%s: ERROR: OpalPrint() access not available\n", PROGNAME);
exit(EXIT_FAILURE);
}
// Open Share Memory created by the model.
ret = OpalOpenAsyncMem(ASYNC_SHMEM_SIZE, ASYNC_SHMEM_NAME);
if (ret != EOK) {
OpalPrint("%s: ERROR: Model shared memory not available\n", PROGNAME);
exit(EXIT_FAILURE);
}
AssignProcToCpu0();
/* Get IP Controler Parameters (ie: ip address, port number...) and
* initialize the device on the QNX node. */
memset(&IconCtrlStruct, 0, sizeof(IconCtrlStruct));
ret = OpalGetAsyncCtrlParameters(&IconCtrlStruct, sizeof(IconCtrlStruct));
if (ret != EOK) {
OpalPrint("%s: ERROR: Could not get controller parameters (%d).\n",
PROGNAME, ret);
exit(EXIT_FAILURE);
}
// Initialize socket
ret = socket_init(&skt, IconCtrlStruct);
if (ret != EOK) {
OpalPrint("%s: ERROR: Failed to create socket.\n", PROGNAME);
exit(EXIT_FAILURE);
}
// Start send/receive threads
ret = pthread_create(&tid_send, NULL, SendToIPPort, NULL);
if (ret < 0)
OpalPrint("%s: ERROR: Could not create thread (SendToIPPort), errno %d\n",
PROGNAME, errno);
ret = pthread_create(&tid_recv, NULL, RecvFromIPPort, NULL);
if (ret < 0)
OpalPrint("%s: ERROR: Could not create thread (RecvFromIPPort), errno %d\n",
PROGNAME, errno);
// Wait for both threads to finish
ret = pthread_join(tid_send, NULL);
if (ret)
OpalPrint("%s: ERROR: pthread_join (SendToIPPort), errno %d\n", PROGNAME,
ret);
ret = pthread_join(tid_recv, NULL);
if (ret)
OpalPrint("%s: ERROR: pthread_join (RecvFromIPPort), errno %d\n", PROGNAME,
ret);
// Close the ip port and shared memories
socket_close(&skt, IconCtrlStruct);
OpalCloseAsyncMem(ASYNC_SHMEM_SIZE, ASYNC_SHMEM_NAME);
OpalSystemCtrl_UnRegister(PRINT_SHMEM_NAME);
return 0;
}

View file

@ -0,0 +1,50 @@
/* Message related functions.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#include <arpa/inet.h>
#include "msg.h"
#include "msg_format.h"
void msg_ntoh(struct msg *m) {
msg_hdr_ntoh(m);
for (int i = 0; i < m->length; i++)
m->data[i].i = ntohl(m->data[i].i);
}
void msg_hton(struct msg *m) {
for (int i = 0; i < m->length; i++)
m->data[i].i = htonl(m->data[i].i);
msg_hdr_hton(m);
}
void msg_hdr_hton(struct msg *m) {
m->length = htons(m->length);
m->sequence = htonl(m->sequence);
m->ts.sec = htonl(m->ts.sec);
m->ts.nsec = htonl(m->ts.nsec);
}
void msg_hdr_ntoh(struct msg *m) {
m->length = ntohs(m->length);
m->sequence = ntohl(m->sequence);
m->ts.sec = ntohl(m->ts.sec);
m->ts.nsec = ntohl(m->ts.nsec);
}
int msg_verify(struct msg *m) {
if (m->version != MSG_VERSION)
return -1;
else if (m->type != MSG_TYPE_DATA)
return -2;
else if (m->reserved1 != 0)
return -3;
else
return 0;
}

View file

@ -0,0 +1,181 @@
/* Helper functions for sockets.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <unistd.h>
/* Define RTLAB before including OpalPrint.h for messages to be sent
* to the OpalDisplay. Otherwise stdout will be used. */
#define RTLAB
#include "AsyncApi.h"
#include "OpalPrint.h"
#include "config.h"
#include "socket.h"
int socket_init(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct) {
struct ip_mreq mreq; // Multicast group structure
unsigned char TTL = 1, LOOP = 0;
int rc, proto, ret;
proto = (int)IconCtrlStruct.FloatParam[0];
if (proto != UDP_PROTOCOL) {
OpalPrint("%s: This version of %s only supports UDP\n", PROGNAME, PROGNAME);
return EIO;
}
OpalPrint("%s: Version : %s\n", PROGNAME, VERSION);
OpalPrint("%s: Remote Address : %s\n", PROGNAME,
IconCtrlStruct.StringParam[0]);
OpalPrint("%s: Remote Port : %d\n", PROGNAME,
(int)IconCtrlStruct.FloatParam[1]);
// Initialize the socket
s->sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (s->sd < 0) {
OpalPrint("%s: ERROR: Could not open socket\n", PROGNAME);
return EIO;
}
// Set the structure for the remote port and address
memset(&s->send_ad, 0, sizeof(s->send_ad));
s->send_ad.sin_family = AF_INET;
s->send_ad.sin_addr.s_addr = inet_addr(IconCtrlStruct.StringParam[0]);
s->send_ad.sin_port = htons((u_short)IconCtrlStruct.FloatParam[1]);
// Set the structure for the local port and address
memset(&s->recv_ad, 0, sizeof(s->recv_ad));
s->recv_ad.sin_family = AF_INET;
s->recv_ad.sin_addr.s_addr = INADDR_ANY;
s->recv_ad.sin_port = htons((u_short)IconCtrlStruct.FloatParam[2]);
// Bind local port and address to socket.
ret = bind(s->sd, (struct sockaddr *)&s->recv_ad, sizeof(struct sockaddr_in));
if (ret < 0) {
OpalPrint("%s: ERROR: Could not bind local port to socket\n", PROGNAME);
return EIO;
} else
OpalPrint("%s: Local Port : %d\n", PROGNAME,
(int)IconCtrlStruct.FloatParam[2]);
// If sending to a multicast address
if ((inet_addr(IconCtrlStruct.StringParam[0]) & inet_addr("240.0.0.0")) ==
inet_addr("224.0.0.0")) {
ret = setsockopt(s->sd, IPPROTO_IP, IP_MULTICAST_TTL, (char *)&TTL,
sizeof(TTL));
if (ret == -1) {
OpalPrint("%s: ERROR: Could not set TTL for multicast send (%d)\n",
PROGNAME, errno);
return EIO;
}
ret = setsockopt(s->sd, IPPROTO_IP, IP_MULTICAST_LOOP, (char *)&LOOP,
sizeof(LOOP));
if (ret == -1) {
OpalPrint("%s: ERROR: Could not set loopback for multicast send (%d)\n",
PROGNAME, errno);
return EIO;
}
OpalPrint("%s: Configured socket for sending to multicast address\n",
PROGNAME);
}
// If receiving from a multicast group, register for it.
if (inet_addr(IconCtrlStruct.StringParam[1]) > 0) {
if ((inet_addr(IconCtrlStruct.StringParam[1]) & inet_addr("240.0.0.0")) ==
inet_addr("224.0.0.0")) {
mreq.imr_multiaddr.s_addr = inet_addr(IconCtrlStruct.StringParam[1]);
mreq.imr_interface.s_addr = INADDR_ANY;
// Have the multicast socket join the multicast group
ret = setsockopt(s->sd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&mreq,
sizeof(mreq));
if (ret == -1) {
OpalPrint("%s: ERROR: Could not join multicast group (%d)\n", PROGNAME,
errno);
return EIO;
}
OpalPrint("%s: Added process to multicast group (%s)\n", PROGNAME,
IconCtrlStruct.StringParam[1]);
} else
OpalPrint("%s: WARNING: IP address for multicast group is not in "
"multicast range. Ignored\n",
PROGNAME);
}
return EOK;
}
int socket_close(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct) {
int ret;
ret = shutdown(s->sd, SHUT_RDWR);
if (ret)
return ret;
ret = close(s->sd);
if (ret)
return ret;
return 0;
}
int socket_send(struct socket *s, char *data, int len) {
return sendto(s->sd, data, len, 0, (struct sockaddr *)&s->send_ad,
sizeof(s->send_ad));
}
int socket_recv(struct socket *s, char *data, int len, double timeout) {
int ret;
struct sockaddr_in client_ad;
struct timeval tv;
socklen_t client_ad_size = sizeof(client_ad);
fd_set sd_set;
// Set the descriptor set for the select() call
FD_ZERO(&sd_set);
FD_SET(s->sd, &sd_set);
// Set the tv structure to the correct timeout value
tv.tv_sec = (int)timeout;
tv.tv_usec = (int)((timeout - tv.tv_sec) * 1000000);
/* Wait for a packet. We use select() to have a timeout. This is
* necessary when reseting the model so we don't wait indefinitely
* and prevent the process from exiting and freeing the port for
* a future instance (model load). */
ret = select(s->sd + 1, &sd_set, (fd_set *)0, (fd_set *)0, &tv);
switch (ret) {
case -1: // Error
return -1;
case 0: // We hit the timeout
return 0;
default:
if (!(FD_ISSET(s->sd, &sd_set))) {
/* We received something, but it's not on "sd". Since sd is the only
* descriptor in the set... */
OpalPrint("%s: RecvPacket: God, is that You trying to reach me?\n",
PROGNAME);
return -1;
}
}
// Clear the data array (in case we receive an incomplete packet)
memset(data, 0, len);
// Perform the reception
return recvfrom(s->sd, data, len, 0, (struct sockaddr *)&client_ad,
&client_ad_size);
}

View file

@ -0,0 +1,36 @@
/* Configure scheduler.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* Author: Mathieu Dubé-Dallaire
* SPDX-FileCopyrightText: 2003 OPAL-RT Technologies inc
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <sched.h>
/* Define RTLAB before including OpalPrint.h for messages to be sent
* to the OpalDisplay. Otherwise stdout will be used. */
#define RTLAB
#include "OpalPrint.h"
#include "config.h"
#include "utils.h"
int AssignProcToCpu0(void) {
int ret;
cpu_set_t bindSet;
CPU_ZERO(&bindSet);
CPU_SET(0, &bindSet);
// Changing process cpu affinity
ret = sched_setaffinity(0, sizeof(cpu_set_t), &bindSet);
if (ret) {
OpalPrint("Unable to bind the process to CPU 0: %d\n", errno);
return EINVAL;
}
return 0;
}

View file

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen
University
SPDX-License-Identifier: Apache-2.0
-->
<Project>
<General>
<att_name>villas_udp</att_name>
<att_description>This is a project!</att_description>
<att_ip_address>10.208.16.93:25251</att_ip_address>
<att_hashcode>1D336193-6957-4E55-B7F9-1E9E09E9BE58</att_hashcode>
<att_autosave>ON</att_autosave>
<att_project_locked>0</att_project_locked>
<att_filename>C:\Git\external\villas\node\clients\opal\villas_udp.llp</att_filename>
</General>
<Optionals>
<att_donotask_loadcfg_at_prjopen>0</att_donotask_loadcfg_at_prjopen>
<att_matlab_compile_outprocess>OFF</att_matlab_compile_outprocess>
<att_donotremind_labviewdeprecated>FALSE</att_donotremind_labviewdeprecated>
</Optionals>
<Models>
<Model>
<Path>
<Relative>models/send_receive/send_receive.mdl</Relative>
<Absolute>
C:/Git/external/villas/node/clients/opal/models/send_receive/send_receive.mdl</Absolute>
<UNC>C:/Git/external/villas/node/clients/opal/models/send_receive/send_receive.mdl</UNC>
</Path>
</Model>
</Models>
</Project>

View file

@ -1 +0,0 @@
*.log

View file

@ -1,8 +0,0 @@
*.o
*.d
AsyncIP
Opcommon/
report/
*_sm_model/
*_ss_model/
*_sc_console.mdl

View file

@ -1,69 +0,0 @@
# Makefile.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
TARGET = AsyncIP
VPATH = src
RTLAB_INTEL_COMPILER ?= 1
# Compiler selection
ifeq ($(RTLAB_INTEL_COMPILER),1)
CC = opicc
LD = opicpc
else
CC = gcc
LD = g++
INTEL_LIBS = -limf -lirc
INTEL_OBJS = compat.o
endif
# Support for debugging symbols
ifeq ($(DEBUG),1)
CC_DEBUG_OPTS = -g -D_DEBUG
LD_DEBUG_OPTS = -g
else
CC_DEBUG_OPTS = -O
LD_DEBUG_OPTS =
endif
TARGET_LIB = -lpthread -lm -ldl -lutil -lrt $(INTEL_LIBS)
LIBPATH = -L. $(OPAL_LIBPATH)
INCLUDES = -I. -Iinclude $(OPAL_INCPATH)
ifneq ($(RTLAB_ROOT),)
INCLUDES += -I$(RTLAB_ROOT)/common/include_target
endif
CC_OPTS = -std=c99 -D_GNU_SOURCE -MMD
LD_OPTS =
OBJS = main.o msg.o utils.o socket.o $(INTEL_OBJS)
ifneq ($(PROTOCOL),)
CC_OPTS += -DPROTOCOL=$(PROTOCOL)
endif
ADDLIB = -lOpalCore -lOpalUtils
LIBS = -lOpalAsyncApiCore $(ADDLIB) $(TARGET_LIB) $(OPAL_LIBS)
CFLAGS = -c $(CC_OPTS) $(CC_DEBUG_OPTS) $(INCLUDES)
LDFLAGS = $(LD_OPTS) $(LD_DEBUG_OPTS) $(LIBPATH)
all: $(TARGET)
install: $(TARGET)
install -m 0755 -D -t $(DESTDIR)$(PREFIX)/bin $(TARGET)
clean:
rm -f $(OBJS) $(OBJS:%.o=%.d) $(TARGET)
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
-include $(wildcard *.d)

View file

@ -1,26 +0,0 @@
/** Compile-time configuration.
*
* @file
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#ifndef _CONFIG_H_
#define _CONFIG_H_
#define PROGNAME "VILLASnode-OPAL-UDP"
#define VERSION "0.7"
#define MAX_VALUES 64
/* List of protocols */
#define VILLAS 1
#define GTNET_SKT 2
/* Default protocol */
#ifndef PROTOCOL
#define PROTOCOL VILLAS
#endif /* PROTOCOL */
#endif /* _CONFIG_H_ */

View file

@ -1,78 +0,0 @@
/** Message format
*
* @file
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#pragma once
#include <stdint.h>
/** The current version number for the message format */
#define MSG_VERSION 2
/** @todo Implement more message types */
#define MSG_TYPE_DATA 0 /**< Message contains float values */
#define MSG_TYPE_START 1 /**< Message marks the beginning of a new simulation case */
#define MSG_TYPE_STOP 2 /**< Message marks the end of a simulation case */
/** The total size in bytes of a message */
#define MSG_LEN(values) (sizeof(struct msg) + MSG_DATA_LEN(values))
/** The length of \p values values in bytes. */
#define MSG_DATA_LEN(values) (sizeof(float) * (values))
/** The offset to the first data value in a message. */
#define MSG_DATA_OFFSET(msg) ((char *) (msg) + offsetof(struct msg, data))
/** Initialize a message with default values */
#define MSG_INIT(len, seq) (struct msg) {\
.version = MSG_VERSION, \
.type = MSG_TYPE_DATA, \
.length = len, \
.sequence = seq, \
.id = 0 \
}
/** The timestamp of a message in struct timespec format */
#define MSG_TS(msg) (struct timespec) { \
.tv_sec = (msg)->ts.sec, \
.tv_nsec = (msg)->ts.nsec \
}
/** This message format is used by all clients
*
* @diafile msg_format.dia
**/
struct msg
{
#if BYTE_ORDER == BIG_ENDIAN
unsigned version: 4; /**< Specifies the format of the remaining message (see MGS_VERSION) */
unsigned type : 2; /**< Data or control message (see MSG_TYPE_*) */
unsigned reserved1 : 2; /**< Reserved bits */
#elif BYTE_ORDER == LITTLE_ENDIAN
unsigned reserved1 : 2; /**< Reserved bits */
unsigned type : 2; /**< Data or control message (see MSG_TYPE_*) */
unsigned version: 4; /**< Specifies the format of the remaining message (see MGS_VERSION) */
#else
#error Invalid byte-order
#endif /* BYTEORDER */
uint8_t id; /**< An id which identifies the source of this sample */
uint16_t length; /**< The number of values in msg::data[]. */
uint32_t sequence; /**< The sequence number is incremented by one for consecutive messages. */
/** A timestamp per message. */
struct {
uint32_t sec; /**< Seconds since 1970-01-01 00:00:00 */
uint32_t nsec; /**< Nanoseconds of the current second. */
} ts;
/** The message payload. */
union {
float f; /**< Floating point values. */
uint32_t i; /**< Integer values. */
} data[];
} __attribute__((packed));

View file

@ -1,34 +0,0 @@
/** Helper functions for sockets.
*
* @file
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#ifndef _SOCKET_H_
#define _SOCKET_H_
#include <netinet/in.h>
#define RT
#include "OpalGenAsyncParamCtrl.h"
#define UDP_PROTOCOL 1
#define TCP_PROTOCOL 2
struct socket {
struct sockaddr_in send_ad; /* Send address */
struct sockaddr_in recv_ad; /* Receive address */
int sd; /* socket descriptor */
};
int socket_init(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct);
int socket_send(struct socket *s, char *data, int len);
int socket_recv(struct socket *s, char *data, int len, double timeout);
int socket_close(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct);
#endif /* _SOCKET_H_ */

View file

@ -1,16 +0,0 @@
/** Configure scheduler.
*
* @file
* @author Steffen Vogel <post@steffenvogel.de>
* @author Mathieu Dubé-Dallaire
* @copyright 2003, OPAL-RT Technologies inc
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#ifndef _UTILS_H_
#define _UTILS_H_
int AssignProcToCpu0(void);
#endif /* _UTILS_H_ */

View file

@ -1,36 +0,0 @@
/** Compatibility code for GCC
*
* OPAL-RT's libSystem.a links against some Intel
*
* @file
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#include <string.h>
size_t __intel_sse2_strlen(const char *s)
{
return strlen(s);
}
void * _intel_fast_memset(void *b, int c, size_t len)
{
return memset(b, c, len);
}
void * _intel_fast_memcpy(void *restrict dst, const void *restrict src, size_t n)
{
return memcpy(dst, src, n);
}
int _intel_fast_memcmp(const void *s1, const void *s2, size_t n)
{
return memcmp(s1, s2, n);
}
void * _intel_fast_memmove(void *dest, const void *src, size_t num)
{
return memmove(dest, src, num);
}

View file

@ -1,336 +0,0 @@
/** Main routine of AsyncIP.
*
* @file
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
/* Standard ANSI C headers needed for this program */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include <pthread.h>
/* Define RTLAB before including OpalPrint.h for messages to be sent
* to the OpalDisplay. Otherwise stdout will be used. */
#define RTLAB
#include "OpalPrint.h"
#include "AsyncApi.h"
/* This is the message format */
#include "config.h"
#include "socket.h"
#include "utils.h"
#if PROTOCOL == VILLAS
#include "msg.h"
#include "msg_format.h"
#endif
/* This is just for initializing the shared memory access to communicate
* with the RT-LAB model. It's easier to remember the arguments like this */
#define ASYNC_SHMEM_NAME argv[1]
#define ASYNC_SHMEM_SIZE atoi(argv[2])
#define PRINT_SHMEM_NAME argv[3]
/* Global Variables */
struct socket skt;
static void * SendToIPPort(void *arg)
{
unsigned int ModelState, SendID = 1, Sequence = 0;
int nbSend = 0, ret, cnt, len;
/* Data from OPAL-RT model */
double mdldata[MAX_VALUES];
int mdldata_size;
#if PROTOCOL == VILLAS
char buf[MSG_LEN(MAX_VALUES)];
struct msg *msg = (struct msg *) buf;
#elif PROTOCOL == GTNET_SKT
char buf[MAX_VALUES * sizeof(float)];
float *msg = (float *) buf;
#endif
OpalPrint("%s: SendToIPPort thread started\n", PROGNAME);
OpalGetNbAsyncSendIcon(&nbSend);
if (nbSend < 1) {
OpalPrint("%s: SendToIPPort: No transimission block for this controller. Stopping thread.\n", PROGNAME);
return NULL;
}
do {
/* This call unblocks when the 'Data Ready' line of a send icon is asserted. */
ret = OpalWaitForAsyncSendRequest(&SendID);
if (ret != EOK) {
ModelState = OpalGetAsyncModelState();
if ((ModelState != STATE_RESET) && (ModelState != STATE_STOP)) {
OpalSetAsyncSendIconError(ret, SendID);
OpalPrint("%s: OpalWaitForAsyncSendRequest(), errno %d\n", PROGNAME, ret);
}
continue;
}
/* No errors encountered yet */
OpalSetAsyncSendIconError(0, SendID);
/* Get the size of the data being sent by the unblocking SendID */
OpalGetAsyncSendIconDataLength(&mdldata_size, SendID);
cnt = mdldata_size / sizeof(double);
if (cnt > MAX_VALUES) {
OpalPrint("%s: Number of signals for SendID=%d exceeds allowed maximum (%d)\n",
PROGNAME, SendID, MAX_VALUES);
return NULL;
}
/* Read data from the model */
OpalGetAsyncSendIconData(mdldata, mdldata_size, SendID);
#if PROTOCOL == VILLAS
/* Get current time */
struct timespec now;
clock_gettime(CLOCK_REALTIME, &now);
msg->length = mdldata_size / sizeof(double);
msg->sequence = Sequence++;
msg->ts.sec = now.tv_sec;
msg->ts.nsec = now.tv_nsec;
for (int i = 0; i < msg->length; i++)
msg->data[i].f = (float) mdldata[i];
msg_hton(msg);
len = MSG_LEN(msg->length);
#elif PROTOCOL == GTNET_SKT
uint32_t *imsg = (uint32_t *) msg;
for (int i = 0; i < cnt; i++) {
msg[i] = (float) mdldata[i];
imsg[i] = htonl(imsg[i]);
}
len = mdldata_size / sizeof(double) * sizeof(float);
#else
#error Unknown protocol
#endif
/* Perform the actual write to the ip port */
ret = socket_send(&skt, (char *) msg, len);
if (ret < 0)
OpalSetAsyncSendIconError(errno, SendID);
else
OpalSetAsyncSendIconError(0, SendID);
/* This next call allows the execution of the "asynchronous" process
* to actually be synchronous with the model. To achieve this, you
* should set the "Sending Mode" in the Async_Send block to
* NEED_REPLY_BEFORE_NEXT_SEND or NEED_REPLY_NOW. This will force
* the model to wait for this process to call this
* OpalAsyncSendRequestDone function before continuing. */
OpalAsyncSendRequestDone(SendID);
/* Before continuing, we make sure that the real-time model
* has not been stopped. If it has, we quit. */
ModelState = OpalGetAsyncModelState();
} while ((ModelState != STATE_RESET) && (ModelState != STATE_STOP));
OpalPrint("%s: SendToIPPort: Finished\n", PROGNAME);
return NULL;
}
static void * RecvFromIPPort(void *arg)
{
unsigned int ModelState, RecvID = 1;
int nbRecv = 0, ret, cnt;
/* Data from OPAL-RT model */
double mdldata[MAX_VALUES];
int mdldata_size;
#if PROTOCOL == VILLAS
char buf[MSG_LEN(MAX_VALUES)];
struct msg *msg = (struct msg *) buf;
#elif PROTOCOL == GTNET_SKT
char buf[MAX_VALUES * sizeof(float)];
float *msg = (float *) buf;
#else
#error Unknown protocol
#endif
OpalPrint("%s: RecvFromIPPort thread started\n", PROGNAME);
OpalGetNbAsyncRecvIcon(&nbRecv);
if (nbRecv < 1) {
OpalPrint("%s: RecvFromIPPort: No reception block for this controller. Stopping thread.\n", PROGNAME);
return NULL;
}
do {
/* Receive message */
ret = socket_recv(&skt, (char *) msg, sizeof(buf), 1.0);
if (ret < 1) {
ModelState = OpalGetAsyncModelState();
if ((ModelState != STATE_RESET) && (ModelState != STATE_STOP)) {
if (ret == 0) /* timeout, so we continue silently */
OpalPrint("%s: Timeout while waiting for data\n", PROGNAME, errno);
if (ret == -1) /* a more serious error, so we print it */
OpalPrint("%s: Error %d while waiting for data\n", PROGNAME, errno);
continue;
}
break;
}
/* Get the number of signals to send back to the model */
OpalGetAsyncRecvIconDataLength(&mdldata_size, RecvID);
cnt = mdldata_size / sizeof(double);
if (cnt > MAX_VALUES) {
OpalPrint("%s: Number of signals for RecvID=%d (%d) exceeds allowed maximum (%d)\n",
PROGNAME, RecvID, cnt, MAX_VALUES);
return NULL;
}
#if PROTOCOL == VILLAS
msg_ntoh(msg);
ret = msg_verify(msg);
if (ret) {
OpalPrint("%s: Skipping invalid packet\n", PROGNAME);
continue;
}
if (cnt > msg->length) {
OpalPrint("%s: Number of signals for RecvID=%d (%d) exceeds what was received (%d)\n",
PROGNAME, RecvID, cnt, msg->length);
}
for (int i = 0; i < msg->length; i++) {
mdldata[i] = (double) msg->data[i].f;
printf("Data rcvd from VILLAS %f\n", mdldata[i]);
}
/* Update OPAL model */
OpalSetAsyncRecvIconStatus(msg->sequence, RecvID); /* Set the Status to the message ID */
#elif PROTOCOL == GTNET_SKT
uint32_t *imsg = (uint32_t *) msg;
for (int i = 0; i < cnt; i++)
imsg[i] = ntohl(imsg[i]);
printf("Protocol GTNET_SKT\n");
for (int i = 0; i < cnt; i++) {
mdldata[i] = (double) msg[i];
printf("Data rcvd from GTNET_SKT %f\n", mdldata[i]);
}
#else
#error Unknown protocol
#endif
OpalSetAsyncRecvIconError(0, RecvID); /* Set the Error to 0 */
OpalSetAsyncRecvIconData(mdldata, mdldata_size, RecvID);
/* Before continuing, we make sure that the real-time model
* has not been stopped. If it has, we quit. */
ModelState = OpalGetAsyncModelState();
} while ((ModelState != STATE_RESET) && (ModelState != STATE_STOP));
OpalPrint("%s: RecvFromIPPort: Finished\n", PROGNAME);
return NULL;
}
int main(int argc, char *argv[])
{
/* @todo remove after testing */
printf("*****************Starting the Application****************\n");
FILE * testfile = fopen ("testfile.txt","w");
if (testfile!=NULL)
{
fputs ("test file to check if main runs", testfile);
fclose (testfile);
}
int ret;
Opal_GenAsyncParam_Ctrl IconCtrlStruct;
pthread_t tid_send, tid_recv;
OpalPrint("%s: This is %s client version %s\n", PROGNAME, PROGNAME, VERSION);
/* Check for the proper arguments to the program */
if (argc < 4) {
printf("Invalid Arguments: 1-AsyncShmemName 2-AsyncShmemSize 3-PrintShmemName\n");
exit(0);
}
/* Enable the OpalPrint function. This prints to the OpalDisplay. */
ret = OpalSystemCtrl_Register(PRINT_SHMEM_NAME);
if (ret != EOK) {
printf("%s: ERROR: OpalPrint() access not available\n", PROGNAME);
exit(EXIT_FAILURE);
}
/* Open Share Memory created by the model. */
ret = OpalOpenAsyncMem(ASYNC_SHMEM_SIZE, ASYNC_SHMEM_NAME);
if (ret != EOK) {
OpalPrint("%s: ERROR: Model shared memory not available\n", PROGNAME);
exit(EXIT_FAILURE);
}
AssignProcToCpu0();
/* Get IP Controler Parameters (ie: ip address, port number...) and
* initialize the device on the QNX node. */
memset(&IconCtrlStruct, 0, sizeof(IconCtrlStruct));
ret = OpalGetAsyncCtrlParameters(&IconCtrlStruct, sizeof(IconCtrlStruct));
if (ret != EOK) {
OpalPrint("%s: ERROR: Could not get controller parameters (%d).\n", PROGNAME, ret);
exit(EXIT_FAILURE);
}
/* Initialize socket */
ret = socket_init(&skt, IconCtrlStruct);
if (ret != EOK) {
OpalPrint("%s: ERROR: Initialization failed.\n", PROGNAME);
exit(EXIT_FAILURE);
}
/* Start send/receive threads */
ret = pthread_create(&tid_send, NULL, SendToIPPort, NULL);
if (ret == -1)
OpalPrint("%s: ERROR: Could not create thread (SendToIPPort), errno %d\n", PROGNAME, errno);
ret = pthread_create(&tid_recv, NULL, RecvFromIPPort, NULL);
if (ret == -1)
OpalPrint("%s: ERROR: Could not create thread (RecvFromIPPort), errno %d\n", PROGNAME, errno);
/* Wait for both threads to finish */
ret = pthread_join(tid_send, NULL);
if (ret != 0)
OpalPrint("%s: ERROR: pthread_join (SendToIPPort), errno %d\n", PROGNAME, ret);
ret = pthread_join(tid_recv, NULL);
if (ret != 0)
OpalPrint("%s: ERROR: pthread_join (RecvFromIPPort), errno %d\n", PROGNAME, ret);
/* Close the ip port and shared memories */
socket_close(&skt, IconCtrlStruct);
OpalCloseAsyncMem (ASYNC_SHMEM_SIZE, ASYNC_SHMEM_NAME);
OpalSystemCtrl_UnRegister(PRINT_SHMEM_NAME);
return 0;
}

View file

@ -1,349 +0,0 @@
/** Main routine of AsyncIP.
*
* @file
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
/* Standard ANSI C headers needed for this program */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include <pthread.h>
/* Define RTLAB before including OpalPrint.h for messages to be sent
* to the OpalDisplay. Otherwise stdout will be used. */
#define RTLAB
#include "OpalPrint.h"
#include "AsyncApi.h"
/* This is the message format */
#include "config.h"
#include "socket.h"
#include "utils.h"
#if PROTOCOL == VILLAS
#include "msg.h"
#include "msg_format.h"
#endif
/* This is just for initializing the shared memory access to communicate
* with the RT-LAB model. It's easier to remember the arguments like this */
#define ASYNC_SHMEM_NAME argv[1]
#define ASYNC_SHMEM_SIZE atoi(argv[2])
#define PRINT_SHMEM_NAME argv[3]
/* Global Variables */
struct socket skt;
static void * SendToIPPort(void *arg)
{
unsigned int ModelState, SendID, Sequence = 0;
int nbSend = 0, ret, cnt, len;
/* Data from OPAL-RT model */
double mdldata[MAX_VALUES];
int mdldata_size;
#if PROTOCOL == VILLAS
char buf[MSG_LEN(MAX_VALUES)];
struct msg *msg = (struct msg *) buf;
#elif PROTOCOL == GTNET_SKT
char buf[MAX_VALUES * sizeof(float)];
float *msg = (float *) buf;
#endif
OpalPrint("%s: SendToIPPort thread started\n", PROGNAME);
OpalGetNbAsyncSendIcon(&nbSend);
if (nbSend < 1) {
OpalPrint("%s: SendToIPPort: No transimission block for this controller. Stopping thread.\n", PROGNAME);
return NULL;
}
do {
/* This call unblocks when the 'Data Ready' line of a send icon is asserted. */
ret = OpalWaitForAsyncSendRequest(&SendID);
if (ret != EOK) {
ModelState = OpalGetAsyncModelState();
if ((ModelState != STATE_RESET) && (ModelState != STATE_STOP)) {
OpalSetAsyncSendIconError(ret, SendID);
OpalPrint("%s: OpalWaitForAsyncSendRequest(), errno %d\n", PROGNAME, ret);
}
continue;
}
/* No errors encountered yet */
OpalSetAsyncSendIconError(0, SendID);
/* Get the size of the data being sent by the unblocking SendID */
OpalGetAsyncSendIconDataLength(&mdldata_size, SendID);
cnt = mdldata_size / sizeof(double);
if (cnt > MAX_VALUES) {
OpalPrint("%s: Number of signals for SendID=%d exceeds allowed maximum (%d). Limiting...\n",
PROGNAME, SendID, MAX_VALUES);
cnt = MAX_VALUES;
}
/* Read data from the model */
OpalGetAsyncSendIconData(mdldata, mdldata_size, SendID);
#if PROTOCOL == VILLAS
/* Get current time */
struct timespec now;
clock_gettime(CLOCK_REALTIME, &now);
msg->version = MSG_VERSION;
msg->type = MSG_TYPE_DATA;
msg->reserved1 = 0;
msg->id = SendID;
msg->length = cnt;
msg->sequence = Sequence++;
msg->ts.sec = now.tv_sec;
msg->ts.nsec = now.tv_nsec;
for (int i = 0; i < msg->length; i++)
msg->data[i].f = (float) mdldata[i];
len = MSG_LEN(msg->length);
msg_hton(msg);
#elif PROTOCOL == GTNET_SKT
uint32_t *imsg = (uint32_t *) msg;
for (int i = 0; i < cnt; i++) {
msg[i] = (float) mdldata[i];
imsg[i] = htonl(imsg[i]);
}
len = cnt * sizeof(float);
#else
#error Unknown protocol
#endif
/* Perform the actual write to the ip port */
ret = socket_send(&skt, (char *) msg, len);
if (ret < 0)
OpalSetAsyncSendIconError(errno, SendID);
else
OpalSetAsyncSendIconError(0, SendID);
/* This next call allows the execution of the "asynchronous" process
* to actually be synchronous with the model. To achieve this, you
* should set the "Sending Mode" in the Async_Send block to
* NEED_REPLY_BEFORE_NEXT_SEND or NEED_REPLY_NOW. This will force
* the model to wait for this process to call this
* OpalAsyncSendRequestDone function before continuing. */
OpalAsyncSendRequestDone(SendID);
/* Before continuing, we make sure that the real-time model
* has not been stopped. If it has, we quit. */
ModelState = OpalGetAsyncModelState();
} while ((ModelState != STATE_RESET) && (ModelState != STATE_STOP));
OpalPrint("%s: SendToIPPort: Finished\n", PROGNAME);
return NULL;
}
static void * RecvFromIPPort(void *arg)
{
unsigned int ModelState, RecvID;
int nbRecv = 0, ret, cnt;
/* Data from OPAL-RT model */
double mdldata[MAX_VALUES];
int mdldata_size;
#if PROTOCOL == VILLAS
char buf[MSG_LEN(MAX_VALUES)];
struct msg *msg = (struct msg *) buf;
#elif PROTOCOL == GTNET_SKT
char buf[MAX_VALUES * sizeof(float)];
float *msg = (float *) buf;
#else
#error Unknown protocol
#endif
OpalPrint("%s: RecvFromIPPort thread started\n", PROGNAME);
OpalGetNbAsyncRecvIcon(&nbRecv);
if (nbRecv < 1) {
OpalPrint("%s: RecvFromIPPort: No reception block for this controller. Stopping thread.\n", PROGNAME);
return NULL;
}
/* Get list of RecvIds */
unsigned int RecvIDs[nbRecv];
ret = OpalGetAsyncRecvIDList(RecvIDs, sizeof(RecvIDs));
if (ret != EOK) {
OpalPrint("%s: Failed to get list of RecvIDs\n", PROGNAME);
return NULL;
}
do {
/* Receive message */
ret = socket_recv(&skt, (char *) msg, sizeof(buf), 1.0);
if (ret < 1) {
ModelState = OpalGetAsyncModelState();
if ((ModelState != STATE_RESET) && (ModelState != STATE_STOP)) {
if (ret == 0) /* timeout, so we continue silently */
OpalPrint("%s: Timeout while waiting for data\n", PROGNAME, errno);
if (ret == -1) /* a more serious error, so we print it */
OpalPrint("%s: Error %d while waiting for data\n", PROGNAME, errno);
continue;
}
break;
}
#if PROTOCOL == VILLAS
RecvID = msg->id;
#elif PROTOCOL == GTNET_SKT
RecvID = 1;
#else
#error Unknown protocol
#endif
/* Check if this RecvID exists */
for (int i = 0; i < nbRecv; i++) {
if (RecvIDs[i] == RecvID)
goto found;
}
OpalPrint("%s: Received message with non-existent RecvID=%d. Changing to RecvID=%d...\n", PROGNAME, RecvID, RecvIDs[0]);
RecvID = RecvIDs[0];
found: /* Get the number of signals to send back to the model */
OpalGetAsyncRecvIconDataLength(&mdldata_size, RecvID);
cnt = mdldata_size / sizeof(double);
if (cnt > MAX_VALUES) {
OpalPrint("%s: Number of signals for RecvID=%d (%d) exceeds allowed maximum (%d)\n",
PROGNAME, RecvID, cnt, MAX_VALUES);
return NULL;
}
#if PROTOCOL == VILLAS
msg_ntoh(msg);
ret = msg_verify(msg);
if (ret) {
OpalPrint("%s: Skipping invalid packet\n", PROGNAME);
continue;
}
if (cnt > msg->length) {
OpalPrint("%s: Number of signals for RecvID=%d (%d) exceeds what was received (%d)\n",
PROGNAME, RecvID, cnt, msg->length);
}
for (int i = 0; i < msg->length; i++)
mdldata[i] = (double) msg->data[i].f;
/* Update OPAL model */
OpalSetAsyncRecvIconStatus(msg->sequence, RecvID); /* Set the Status to the message ID */
#elif PROTOCOL == GTNET_SKT
uint32_t *imsg = (uint32_t *) msg;
for (int i = 0; i < cnt; i++) {
imsg[i] = ntohl(imsg[i]);
mdldata[i] = (double) msg[i];
}
#else
#error Unknown protocol
#endif
OpalSetAsyncRecvIconError(0, RecvID); /* Set the Error to 0 */
OpalSetAsyncRecvIconData(mdldata, mdldata_size, RecvID);
/* Before continuing, we make sure that the real-time model
* has not been stopped. If it has, we quit. */
ModelState = OpalGetAsyncModelState();
} while ((ModelState != STATE_RESET) && (ModelState != STATE_STOP));
OpalPrint("%s: RecvFromIPPort: Finished\n", PROGNAME);
return NULL;
}
int main(int argc, char *argv[])
{
int ret;
Opal_GenAsyncParam_Ctrl IconCtrlStruct;
pthread_t tid_send, tid_recv;
OpalPrint("%s: This is %s client version %s\n", PROGNAME, PROGNAME, VERSION);
/* Check for the proper arguments to the program */
if (argc < 4) {
printf("Invalid Arguments: 1-AsyncShmemName 2-AsyncShmemSize 3-PrintShmemName\n");
exit(0);
}
/* Enable the OpalPrint function. This prints to the OpalDisplay. */
ret = OpalSystemCtrl_Register(PRINT_SHMEM_NAME);
if (ret != EOK) {
printf("%s: ERROR: OpalPrint() access not available\n", PROGNAME);
exit(EXIT_FAILURE);
}
/* Open Share Memory created by the model. */
ret = OpalOpenAsyncMem(ASYNC_SHMEM_SIZE, ASYNC_SHMEM_NAME);
if (ret != EOK) {
OpalPrint("%s: ERROR: Model shared memory not available\n", PROGNAME);
exit(EXIT_FAILURE);
}
AssignProcToCpu0();
/* Get IP Controler Parameters (ie: ip address, port number...) and
* initialize the device on the QNX node. */
memset(&IconCtrlStruct, 0, sizeof(IconCtrlStruct));
ret = OpalGetAsyncCtrlParameters(&IconCtrlStruct, sizeof(IconCtrlStruct));
if (ret != EOK) {
OpalPrint("%s: ERROR: Could not get controller parameters (%d).\n", PROGNAME, ret);
exit(EXIT_FAILURE);
}
/* Initialize socket */
ret = socket_init(&skt, IconCtrlStruct);
if (ret != EOK) {
OpalPrint("%s: ERROR: Failed to create socket.\n", PROGNAME);
exit(EXIT_FAILURE);
}
/* Start send/receive threads */
ret = pthread_create(&tid_send, NULL, SendToIPPort, NULL);
if (ret < 0)
OpalPrint("%s: ERROR: Could not create thread (SendToIPPort), errno %d\n", PROGNAME, errno);
ret = pthread_create(&tid_recv, NULL, RecvFromIPPort, NULL);
if (ret < 0)
OpalPrint("%s: ERROR: Could not create thread (RecvFromIPPort), errno %d\n", PROGNAME, errno);
/* Wait for both threads to finish */
ret = pthread_join(tid_send, NULL);
if (ret)
OpalPrint("%s: ERROR: pthread_join (SendToIPPort), errno %d\n", PROGNAME, ret);
ret = pthread_join(tid_recv, NULL);
if (ret)
OpalPrint("%s: ERROR: pthread_join (RecvFromIPPort), errno %d\n", PROGNAME, ret);
/* Close the ip port and shared memories */
socket_close(&skt, IconCtrlStruct);
OpalCloseAsyncMem (ASYNC_SHMEM_SIZE, ASYNC_SHMEM_NAME);
OpalSystemCtrl_UnRegister(PRINT_SHMEM_NAME);
return 0;
}

View file

@ -1,55 +0,0 @@
/** Message related functions.
*
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#include <arpa/inet.h>
#include "msg.h"
#include "msg_format.h"
void msg_ntoh(struct msg *m)
{
msg_hdr_ntoh(m);
for (int i = 0; i < m->length; i++)
m->data[i].i = ntohl(m->data[i].i);
}
void msg_hton(struct msg *m)
{
for (int i = 0; i < m->length; i++)
m->data[i].i = htonl(m->data[i].i);
msg_hdr_hton(m);
}
void msg_hdr_hton(struct msg *m)
{
m->length = htons(m->length);
m->sequence = htonl(m->sequence);
m->ts.sec = htonl(m->ts.sec);
m->ts.nsec = htonl(m->ts.nsec);
}
void msg_hdr_ntoh(struct msg *m)
{
m->length = ntohs(m->length);
m->sequence = ntohl(m->sequence);
m->ts.sec = ntohl(m->ts.sec);
m->ts.nsec = ntohl(m->ts.nsec);
}
int msg_verify(struct msg *m)
{
if (m->version != MSG_VERSION)
return -1;
else if (m->type != MSG_TYPE_DATA)
return -2;
else if (m->reserved1 != 0)
return -3;
else
return 0;
}

View file

@ -1,169 +0,0 @@
/** Helper functions for sockets.
*
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <arpa/inet.h>
/* Define RTLAB before including OpalPrint.h for messages to be sent
* to the OpalDisplay. Otherwise stdout will be used. */
#define RTLAB
#include "OpalPrint.h"
#include "AsyncApi.h"
#include "config.h"
#include "socket.h"
int socket_init(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct)
{
struct ip_mreq mreq; /* Multicast group structure */
unsigned char TTL = 1, LOOP = 0;
int rc, proto, ret;
proto = (int) IconCtrlStruct.FloatParam[0];
if (proto != UDP_PROTOCOL) {
OpalPrint("%s: This version of %s only supports UDP\n", PROGNAME, PROGNAME);
return EIO;
}
OpalPrint("%s: Version : %s\n", PROGNAME, VERSION);
OpalPrint("%s: Remote Address : %s\n", PROGNAME, IconCtrlStruct.StringParam[0]);
OpalPrint("%s: Remote Port : %d\n", PROGNAME, (int) IconCtrlStruct.FloatParam[1]);
/* Initialize the socket */
s->sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (s->sd < 0) {
OpalPrint("%s: ERROR: Could not open socket\n", PROGNAME);
return EIO;
}
/* Set the structure for the remote port and address */
memset(&s->send_ad, 0, sizeof(s->send_ad));
s->send_ad.sin_family = AF_INET;
s->send_ad.sin_addr.s_addr = inet_addr(IconCtrlStruct.StringParam[0]);
s->send_ad.sin_port = htons((u_short) IconCtrlStruct.FloatParam[1]);
/* Set the structure for the local port and address */
memset(&s->recv_ad, 0, sizeof(s->recv_ad));
s->recv_ad.sin_family = AF_INET;
s->recv_ad.sin_addr.s_addr = INADDR_ANY;
s->recv_ad.sin_port = htons((u_short) IconCtrlStruct.FloatParam[2]);
/* Bind local port and address to socket. */
ret = bind(s->sd, (struct sockaddr *) &s->recv_ad, sizeof(struct sockaddr_in));
if (ret < 0) {
OpalPrint("%s: ERROR: Could not bind local port to socket\n", PROGNAME);
return EIO;
}
else
OpalPrint("%s: Local Port : %d\n", PROGNAME, (int) IconCtrlStruct.FloatParam[2]);
/* If sending to a multicast address */
if ((inet_addr(IconCtrlStruct.StringParam[0]) & inet_addr("240.0.0.0")) == inet_addr("224.0.0.0")) {
ret = setsockopt(s->sd, IPPROTO_IP, IP_MULTICAST_TTL, (char *) &TTL, sizeof(TTL));
if (ret == -1) {
OpalPrint("%s: ERROR: Could not set TTL for multicast send (%d)\n", PROGNAME, errno);
return EIO;
}
ret = setsockopt(s->sd, IPPROTO_IP, IP_MULTICAST_LOOP, (char *)&LOOP, sizeof(LOOP));
if (ret == -1) {
OpalPrint("%s: ERROR: Could not set loopback for multicast send (%d)\n", PROGNAME, errno);
return EIO;
}
OpalPrint("%s: Configured socket for sending to multicast address\n", PROGNAME);
}
/* If receiving from a multicast group, register for it. */
if (inet_addr(IconCtrlStruct.StringParam[1]) > 0) {
if ((inet_addr(IconCtrlStruct.StringParam[1]) & inet_addr("240.0.0.0")) == inet_addr("224.0.0.0")) {
mreq.imr_multiaddr.s_addr = inet_addr(IconCtrlStruct.StringParam[1]);
mreq.imr_interface.s_addr = INADDR_ANY;
/* Have the multicast socket join the multicast group */
ret = setsockopt(s->sd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &mreq, sizeof(mreq));
if (ret == -1) {
OpalPrint("%s: ERROR: Could not join multicast group (%d)\n", PROGNAME, errno);
return EIO;
}
OpalPrint("%s: Added process to multicast group (%s)\n", PROGNAME, IconCtrlStruct.StringParam[1]);
}
else
OpalPrint("%s: WARNING: IP address for multicast group is not in multicast range. Ignored\n", PROGNAME);
}
return EOK;
}
int socket_close(struct socket *s, Opal_GenAsyncParam_Ctrl IconCtrlStruct)
{
int ret;
ret = shutdown(s->sd, SHUT_RDWR);
if (ret)
return ret;
ret = close(s->sd);
if (ret)
return ret;
return 0;
}
int socket_send(struct socket *s, char *data, int len)
{
return sendto(s->sd, data, len, 0, (struct sockaddr *) &s->send_ad, sizeof(s->send_ad));
}
int socket_recv(struct socket *s, char *data, int len, double timeout)
{
int ret;
struct sockaddr_in client_ad;
struct timeval tv;
socklen_t client_ad_size = sizeof(client_ad);
fd_set sd_set;
/* Set the descriptor set for the select() call */
FD_ZERO(&sd_set);
FD_SET(s->sd, &sd_set);
/* Set the tv structure to the correct timeout value */
tv.tv_sec = (int) timeout;
tv.tv_usec = (int) ((timeout - tv.tv_sec) * 1000000);
/* Wait for a packet. We use select() to have a timeout. This is
* necessary when reseting the model so we don't wait indefinitely
* and prevent the process from exiting and freeing the port for
* a future instance (model load). */
ret = select(s->sd + 1, &sd_set, (fd_set *) 0, (fd_set *) 0, &tv);
switch (ret) {
case -1: /* Error */
return -1;
case 0: /* We hit the timeout */
return 0;
default:
if (!(FD_ISSET(s->sd, &sd_set))) {
/* We received something, but it's not on "sd". Since sd is the only
* descriptor in the set... */
OpalPrint("%s: RecvPacket: God, is that You trying to reach me?\n", PROGNAME);
return -1;
}
}
/* Clear the data array (in case we receive an incomplete packet) */
memset(data, 0, len);
/* Perform the reception */
return recvfrom(s->sd, data, len, 0, (struct sockaddr *) &client_ad, &client_ad_size);
}

View file

@ -1,37 +0,0 @@
/** Configure scheduler.
*
* @author Steffen Vogel <post@steffenvogel.de>
* @author Mathieu Dubé-Dallaire
* @copyright 2003, OPAL-RT Technologies inc
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#include <errno.h>
#include <sched.h>
/* Define RTLAB before including OpalPrint.h for messages to be sent
* to the OpalDisplay. Otherwise stdout will be used. */
#define RTLAB
#include "OpalPrint.h"
#include "config.h"
#include "utils.h"
int AssignProcToCpu0(void)
{
int ret;
cpu_set_t bindSet;
CPU_ZERO(&bindSet);
CPU_SET(0, &bindSet);
/* Changing process cpu affinity */
ret = sched_setaffinity(0, sizeof(cpu_set_t), &bindSet);
if (ret) {
OpalPrint("Unable to bind the process to CPU 0: %d\n", errno);
return EINVAL;
}
return 0;
}

View file

@ -1,20 +0,0 @@
<?xml version="1.0" ?>
<Project>
<General>
<att_name>villas_udp</att_name>
<att_description>This is a project!</att_description>
<att_ip_address>134.130.169.120:25251</att_ip_address>
<att_hashcode>7CA55C76-B20E-414C-93F2-A1858B0095F3</att_hashcode>
<att_autosave>ON</att_autosave>
<att_filename>C:\Users\svo\workspace\villas\node\clients\opal\villas_udp.llp</att_filename>
</General>
<Models>
<Model>
<Path>
<Relative>models/send_receive/send_receive.mdl</Relative>
<Absolute>C:/Users/svo/workspace/villas/node/clients/opal/models/send_receive/send_receive.mdl</Absolute>
<UNC>C:/Users/svo/workspace/villas/node/clients/opal/models/send_receive/send_receive.mdl</UNC>
</Path>
</Model>
</Models>
</Project>

View file

@ -1,53 +1,57 @@
# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
import villas_pb2
import time, socket, errno, sys, os, signal
layer = sys.argv[1] if len(sys.argv) == 2 else 'udp'
layer = sys.argv[1] if len(sys.argv) == 2 else "udp"
if layer not in ['udp', 'unix']:
raise Exception('Unsupported socket type')
if layer not in ["udp", "unix"]:
raise Exception("Unsupported socket type")
if layer == 'unix':
local = '/var/run/villas-node.client.sock'
remote = '/var/run/villas-node.server.sock'
if layer == "unix":
local = "/var/run/villas-node.client.sock"
remote = "/var/run/villas-node.server.sock"
skt = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
skt = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
# Delete stale sockets
if os.path.exists(local):
os.unlink(local)
elif layer == 'udp':
local = ('0.0.0.0', 12001)
remote = ('127.0.0.1', 12000)
# Delete stale sockets
if os.path.exists(local):
os.unlink(local)
elif layer == "udp":
local = ("0.0.0.0", 12001)
remote = ("127.0.0.1", 12000)
skt = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
skt = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
print('Start client...')
print("Start client...")
skt.bind(local)
# Try to connect in case Unix domain socket does not exist yet..
connected = False
while not connected:
try:
skt.connect(remote)
except socket.error as serr:
if serr.errno not in [ errno.ECONNREFUSED, errno.ENOENT ]:
raise serr
print('Not connected. Retrying in 1 sec')
time.sleep(1)
else:
connected = True
try:
skt.connect(remote)
except socket.error as serr:
if serr.errno not in [errno.ECONNREFUSED, errno.ENOENT]:
raise serr
print('Ready. Ctrl-C to quit.')
print("Not connected. Retrying in 1 sec")
time.sleep(1)
else:
connected = True
print("Ready. Ctrl-C to quit.")
msg = villas_pb2.Message()
# Gracefully shutdown
def sighandler(signum, frame):
running = False
running = False
signal.signal(signal.SIGINT, sighandler)
signal.signal(signal.SIGTERM, sighandler)
@ -55,15 +59,15 @@ signal.signal(signal.SIGTERM, sighandler)
running = True
while running:
dgram = skt.recv(1024)
if not dgram:
break
else:
msg.ParseFromString(dgram)
print(msg)
skt.send(msg.SerializeToString())
dgram = skt.recv(1024)
if not dgram:
break
else:
msg.ParseFromString(dgram)
print(msg)
skt.send(msg.SerializeToString())
skt.close()
print('Bye.')
print("Bye.")

View file

@ -1,9 +1,8 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
add_executable(villas-shmem villas-shmem.cpp)

View file

@ -1,26 +1,26 @@
/** Test "client" for the shared memory interface.
/* Test "client" for the shared memory interface.
*
* Waits on the incoming queue, prints received samples and writes them
* back to the other queue.
*
* @author Georg Martin Reinke <georg.reinke@rwth-aachen.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
* Author: Georg Martin Reinke <georg.reinke@rwth-aachen.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#include <iostream>
#include <atomic>
#include <iostream>
#include <villas/node/config.hpp>
#include <villas/colors.hpp>
#include <villas/log.hpp>
#include <villas/node.hpp>
#include <villas/node/config.hpp>
#include <villas/node/exceptions.hpp>
#include <villas/pool.hpp>
#include <villas/sample.hpp>
#include <villas/shmem.hpp>
#include <villas/colors.hpp>
#include <villas/tool.hpp>
#include <villas/log.hpp>
#include <villas/utils.hpp>
#include <villas/node/exceptions.hpp>
namespace villas {
namespace node {
@ -29,101 +29,94 @@ namespace tools {
class Shmem : public Tool {
public:
Shmem(int argc, char *argv[]) :
Tool(argc, argv, "shmem"),
stop(false)
{ }
Shmem(int argc, char *argv[]) : Tool(argc, argv, "shmem"), stop(false) {}
protected:
std::atomic<bool> stop;
std::atomic<bool> stop;
void usage()
{
std::cout << "Usage: villas-test-shmem WNAME VECTORIZE" << std::endl
<< " WNAME name of the shared memory object for the output queue" << std::endl
<< " RNAME name of the shared memory object for the input queue" << std::endl
<< " VECTORIZE maximum number of samples to read/write at a time" << std::endl;
void usage() {
std::cout
<< "Usage: villas-test-shmem WNAME VECTORIZE" << std::endl
<< " WNAME name of the shared memory object for the output queue"
<< std::endl
<< " RNAME name of the shared memory object for the input queue"
<< std::endl
<< " VECTORIZE maximum number of samples to read/write at a time"
<< std::endl;
printCopyright();
}
printCopyright();
}
void handler(int, siginfo_t *, void *)
{
stop = true;
}
void handler(int, siginfo_t *, void *) { stop = true; }
int main()
{
int ret, readcnt, writecnt, avail;
int main() {
int ret, readcnt, writecnt, avail;
struct ShmemInterface shm;
struct ShmemConfig conf = {
.polling = 0,
.queuelen = DEFAULT_SHMEM_QUEUELEN,
.samplelen = DEFAULT_SHMEM_SAMPLELEN
};
struct ShmemInterface shm;
struct ShmemConfig conf = {.polling = 0,
.queuelen = DEFAULT_SHMEM_QUEUELEN,
.samplelen = DEFAULT_SHMEM_SAMPLELEN};
if (argc != 4) {
usage();
return 1;
}
if (argc != 4) {
usage();
return 1;
}
std::string wname = argv[1];
std::string rname = argv[2];
int vectorize = atoi(argv[3]);
std::string wname = argv[1];
std::string rname = argv[2];
int vectorize = atoi(argv[3]);
ret = shmem_int_open(wname.c_str(), rname.c_str(), &shm, &conf);
if (ret < 0)
throw RuntimeError("Failed to open shared-memory interface");
ret = shmem_int_open(wname.c_str(), rname.c_str(), &shm, &conf);
if (ret < 0)
throw RuntimeError("Failed to open shared-memory interface");
struct Sample *insmps[vectorize], *outsmps[vectorize];
struct Sample *insmps[vectorize], *outsmps[vectorize];
while (!stop) {
readcnt = shmem_int_read(&shm, insmps, vectorize);
if (readcnt == -1) {
logger->info("Node stopped, exiting");
break;
}
while (!stop) {
readcnt = shmem_int_read(&shm, insmps, vectorize);
if (readcnt == -1) {
logger->info("Node stopped, exiting");
break;
}
avail = shmem_int_alloc(&shm, outsmps, readcnt);
if (avail < readcnt)
logger->warn("Pool underrun: {} / {}", avail, readcnt);
avail = shmem_int_alloc(&shm, outsmps, readcnt);
if (avail < readcnt)
logger->warn("Pool underrun: {} / {}", avail, readcnt);
for (int i = 0; i < avail; i++) {
outsmps[i]->sequence = insmps[i]->sequence;
outsmps[i]->ts = insmps[i]->ts;
for (int i = 0; i < avail; i++) {
outsmps[i]->sequence = insmps[i]->sequence;
outsmps[i]->ts = insmps[i]->ts;
int len = MIN(insmps[i]->length, outsmps[i]->capacity);
memcpy(outsmps[i]->data, insmps[i]->data, SAMPLE_DATA_LENGTH(len));
int len = MIN(insmps[i]->length, outsmps[i]->capacity);
memcpy(outsmps[i]->data, insmps[i]->data, SAMPLE_DATA_LENGTH(len));
outsmps[i]->length = len;
}
outsmps[i]->length = len;
}
for (int i = 0; i < readcnt; i++)
sample_decref(insmps[i]);
for (int i = 0; i < readcnt; i++)
sample_decref(insmps[i]);
writecnt = shmem_int_write(&shm, outsmps, avail);
if (writecnt < avail)
logger->warn("Short write");
writecnt = shmem_int_write(&shm, outsmps, avail);
if (writecnt < avail)
logger->warn("Short write");
logger->info("Read / Write: {}/{}", readcnt, writecnt);
}
logger->info("Read / Write: {}/{}", readcnt, writecnt);
}
ret = shmem_int_close(&shm);
if (ret)
throw RuntimeError("Failed to close shared-memory interface");
ret = shmem_int_close(&shm);
if (ret)
throw RuntimeError("Failed to close shared-memory interface");
return 0;
}
return 0;
}
};
} /* namespace tools */
} /* namespace node */
} /* namespace villas */
} // namespace tools
} // namespace node
} // namespace villas
int main(int argc, char *argv[])
{
villas::node::tools::Shmem t(argc, argv);
int main(int argc, char *argv[]) {
villas::node::tools::Shmem t(argc, argv);
return t.run();
return t.run();
}

View file

@ -1,5 +1,8 @@
version = 4.2
// SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
// SPDX-License-Identifier: Apache-2.0
//
// Saved by sw version: 2022.1 SP1
// Save timestamp: 24-Mar-2022 @ 04:26:31 PM

28
cmake/FindCriterion.cmake Normal file
View file

@ -0,0 +1,28 @@
# Try to find Criterion
#
# Once done this will define
# CRITERION_FOUND - System has Criterion
# CRITERION_INCLUDE_DIRS - The Criterion include directories
# CRITERION_LIBRARIES - The libraries needed to use Criterion
#
# SPDX-FileCopyrightText: 2017 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
find_package(PkgConfig)
find_path(CRITERION_INCLUDE_DIR criterion/criterion.h
PATH_SUFFIXES criterion)
find_library(CRITERION_LIBRARY NAMES criterion libcriterion)
set(CRITERION_LIBRARIES ${CRITERION_LIBRARY})
set(CRITERION_INCLUDE_DIRS ${CRITERION_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# Handle the QUIET and REQUIRED arguments and set CRITERION_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Criterion DEFAULT_MSG
CRITERION_LIBRARY CRITERION_INCLUDE_DIR)
mark_as_advanced(CRITERION_INCLUDE_DIR CRITERION_LIBRARY)

View file

@ -1,21 +1,20 @@
# CMakeLists.txt.
#
# @author Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2018, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2018 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
find_path(ETHERLAB_INCLUDE_DIR
NAMES ecrt.h
PATHS
/opt/etherlab/include
NAMES ecrt.h
PATHS
/opt/etherlab/include
)
find_library(ETHERLAB_LIBRARY
NAMES ethercat
PATHS
/opt/etherlab/lib
NAMES ethercat
PATHS
/opt/etherlab/lib
)
include(FindPackageHandleStandardArgs)

View file

@ -1,23 +1,22 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
find_path(IBVERBS_INCLUDE_DIR
NAMES infiniband/verbs.h
NAMES infiniband/verbs.h
)
find_library(IBVERBS_LIBRARY
NAMES ibverbs
NAMES ibverbs
)
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set VILLASNODE_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(IBVerbs DEFAULT_MSG
IBVERBS_LIBRARY IBVERBS_INCLUDE_DIR)
IBVERBS_LIBRARY IBVERBS_INCLUDE_DIR)
mark_as_advanced(IBVERBS_INCLUDE_DIR IBVERBS_LIBRARY)

View file

@ -1,54 +0,0 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
set(OPAL_PREFIX /usr/opalrt/common)
find_path(OPAL_INCLUDE_DIR
NAMES AsyncApi.h
HINTS
${OPAL_PREFIX}/include_target/
${PROJECT_SOURCE_DIR}/libopal/include/opal/
)
find_library(OPAL_LIBRARY
NAMES OpalAsyncApiCore
HINTS
${OPAL_PREFIX}/lib/
${PROJECT_SOURCE_DIR}/libopal/
)
find_library(OPAL_LIBRARY_IRC
NAMES irc
HINTS
${OPAL_PREFIX}/lib/
${PROJECT_SOURCE_DIR}/libopal/
)
find_library(OPAL_LIBRARY_UTILS
NAMES OpalUtils
HINTS
${OPAL_PREFIX}/lib/redhawk/
${OPAL_PREFIX}/lib/redhawk64/
${PROJECT_SOURCE_DIR}/libopal/
)
find_library(OPAL_LIBRARY_CORE
NAMES OpalCore
HINTS
${OPAL_PREFIX}/lib/redhawk/
${OPAL_PREFIX}/lib/redhawk64/
${PROJECT_SOURCE_DIR}/libopal/
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Opal DEFAULT_MSG OPAL_LIBRARY OPAL_LIBRARY_UTILS OPAL_LIBRARY_CORE OPAL_LIBRARY_IRC OPAL_INCLUDE_DIR)
mark_as_advanced(OPAL_INCLUDE_DIR OPAL_LIBRARY)
set(OPAL_LIBRARIES ${OPAL_LIBRARY} ${OPAL_LIBRARY_UTILS} ${OPAL_LIBRARY_CORE} ${OPAL_LIBRARY_IRC} $ENV{OPAL_LIBPATH} $ENV{OPAL_LIBS})
set(OPAL_INCLUDE_DIRS ${OPAL_INCLUDE_DIR})

View file

@ -1,23 +1,22 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
find_path(RDMACM_INCLUDE_DIR
NAMES rdma/rdma_cma.h
NAMES rdma/rdma_cma.h
)
find_library(RDMACM_LIBRARY
NAMES rdmacm
NAMES rdmacm
)
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set VILLASNODE_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(RDMACM DEFAULT_MSG
RDMACM_LIBRARY RDMACM_INCLUDE_DIR)
RDMACM_LIBRARY RDMACM_INCLUDE_DIR)
mark_as_advanced(RDMACM_INCLUDE_DIR RDMACM_LIBRARY)

View file

@ -1,21 +1,20 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
function(FindSymbol LIBRARY SYMBOL FOUND)
find_program(OBJDUMP_EXECUTABLE NAMES objdump)
find_program(OBJDUMP_EXECUTABLE NAMES objdump)
execute_process(
COMMAND /bin/sh -c "${OBJDUMP_EXECUTABLE} -T ${LIBRARY} | grep ${SYMBOL} | wc -l"
OUTPUT_VARIABLE OUTPUT
)
execute_process(
COMMAND /bin/sh -c "${OBJDUMP_EXECUTABLE} -T ${LIBRARY} | grep ${SYMBOL} | wc -l"
OUTPUT_VARIABLE OUTPUT
)
if(OUTPUT GREATER 0)
set(${FOUND} "${SYMBOL}" PARENT_SCOPE)
else()
set(${FOUND} "${SYMBOL}-NOTFOUND" PARENT_SCOPE)
endif()
if(OUTPUT GREATER 0)
set(${FOUND} "${SYMBOL}" PARENT_SCOPE)
else()
set(${FOUND} "${SYMBOL}-NOTFOUND" PARENT_SCOPE)
endif()
endfunction()

105
cmake/GetVersion.cmake Normal file
View file

@ -0,0 +1,105 @@
# CMakeLists.txt.
#
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
#
# VILLASnode
# This CMake function sets the following variables:
#
# ${PREFIX}_VERSION_STR v0.6.3
# ${PREFIX}_VERSION 0.6.3
# ${PREFIX}_MAJOR_VERSION 0
# ${PREFIX}_MINOR_VERSION 6
# ${PREFIX}_PATCH_VERSION 3
# ${PREFIX}_RELEASE 1.ci_tests_release.20180823git1cd25c2f
# ${PREFIX}_GIT_REV 1cd25c2f
# ${PREFIX}_GIT_BRANCH ci-tests
# ${PREFIX}_GIT_BRANCH_NORM ci_tests
# ${PREFIX}_VARIANT release
# ${PREFIX}_VARIANT_NORM release
# ${PREFIX}_BUILD_ID v0.6.3-1cd25c2f-release
# ${PREFIX}_BUILD_DATE 20180823
function(GetVersion DIR PREFIX)
execute_process(
COMMAND git describe --tags --abbrev=0 --match "v*"
WORKING_DIRECTORY ${DIR}
OUTPUT_VARIABLE VERSION_STR
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
RESULT_VARIABLE RC
)
if(NOT RC EQUAL 0)
set(FOUND_GIT_VERSION OFF PARENT_SCOPE)
message(WARNING
"Failed to retrieve version information from Git. "
"Make sure that the source directory is a Git repo and "
"contains at least one valid tag like 'v0.1.0'"
)
else()
set(FOUND_GIT_VERSION ON PARENT_SCOPE)
string(REGEX REPLACE "^v([0-9]+\\.[0-9]+\\.[0-9]+)$" "\\1" VERSION ${VERSION_STR})
string(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" MAJOR_VERSION ${VERSION_STR})
string(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" MINOR_VERSION ${VERSION_STR})
string(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" PATCH_VERSION ${VERSION_STR})
string(TIMESTAMP BUILD_DATE "%Y%m%d")
if(CMAKE_BUILD_TYPE)
string(TOLOWER "${CMAKE_BUILD_TYPE}" VARIANT)
else()
set(VARIANT "release")
endif()
if(DEFINED ENV{CI})
string(APPEND VARIANT "-ci")
string(SUBSTRING $ENV{CI_COMMIT_SHA} 0 7 GIT_REV)
set(GIT_BRANCH $ENV{CI_COMMIT_REF_NAME})
else()
execute_process(
COMMAND git rev-parse --short=7 HEAD
WORKING_DIRECTORY ${DIR}
OUTPUT_VARIABLE GIT_REV
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
if(DEFINED ENV{CI_COMMIT_TAG})
set(RELEASE 1)
else()
string(REPLACE "-" "_" GIT_BRANCH_NORM ${GIT_BRANCH})
string(REPLACE "-" "_" VARIANT_NORM ${VARIANT})
set(RELEASE "1.${GIT_BRANCH_NORM}_${VARIANT_NORM}.${BUILD_DATE}git${GIT_REV}")
endif()
set(BUILD_ID "v${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${GIT_REV}-${VARIANT}" )
# Return results to parent scope
set(${PREFIX}_VERSION_STR ${VERSION_STR} PARENT_SCOPE)
set(${PREFIX}_VERSION ${VERSION} PARENT_SCOPE)
set(${PREFIX}_MAJOR_VERSION ${MAJOR_VERSION} PARENT_SCOPE)
set(${PREFIX}_MINOR_VERSION ${MINOR_VERSION} PARENT_SCOPE)
set(${PREFIX}_PATCH_VERSION ${PATCH_VERSION} PARENT_SCOPE)
set(${PREFIX}_RELEASE ${RELEASE} PARENT_SCOPE)
set(${PREFIX}_GIT_REV ${GIT_REV} PARENT_SCOPE)
set(${PREFIX}_GIT_BRANCH ${GIT_BRANCH} PARENT_SCOPE)
set(${PREFIX}_GIT_BRANCH_NORM ${GIT_BRANCH_NORM} PARENT_SCOPE)
set(${PREFIX}_VARIANT ${VARIANT} PARENT_SCOPE)
set(${PREFIX}_VARIANT_NORM ${VARIANT_NORM} PARENT_SCOPE)
set(${PREFIX}_BUILD_ID ${BUILD_ID} PARENT_SCOPE)
set(${PREFIX}_BUILD_DATE ${BUILD_DATE} PARENT_SCOPE)
endif()
endfunction(GetVersion)

View file

@ -1,28 +0,0 @@
if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(GO_DOWNLOAD_ARCH "amd64")
set(GO_DOWNLOAD_HASH "980e65a863377e69fd9b67df9d8395fd8e93858e7a24c9f55803421e453f4f99")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(GO_DOWNLOAD_ARCH "arm64")
set(GO_DOWNLOAD_HASH "57a9171682e297df1a5bd287be056ed0280195ad079af90af16dcad4f64710cb")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "armv7l")
set(GO_DOWNLOAD_ARCH "armv6l")
set(GO_DOWNLOAD_HASH "3287ca2fe6819fa87af95182d5942bf4fa565aff8f145812c6c70c0466ce25ae")
endif()
FetchContent_Declare(
go
URL https://go.dev/dl/go1.17.8.linux-${GO_DOWNLOAD_ARCH}.tar.gz
URL_HASH SHA256=${GO_DOWNLOAD_HASH}
)
message(STATUS "Downloading Go toolchain for linux/${GO_DOWNLOAD_ARCH}")
FetchContent_MakeAvailable(go)
find_program(GO
NAMES go
NO_DEFAULT_PATH
PATHS
${CMAKE_CURRENT_BINARY_DIR}/_deps/go-src/bin
${go_SOURCE_DIR}
)

View file

@ -1,9 +1,8 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
include(CPackComponent)
get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
@ -13,7 +12,7 @@ set(CPACK_BUILD_SOURCE_DIRS ${PROJECT_SOURCE_DIR}/src;${PROJECT_SOURCE_DIR}/lib;
set(CPACK_PACKAGE_NAME "villas-node")
set(CPACK_PACKAGE_VENDOR ${PROJECT_AUTHOR})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "This is VILLASnode, a gateway for processing and forwardning simulation data between real-time simulators.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Connecting real-time power grid simulation equipment")
set(CPACK_PACKAGE_VERSION ${CMAKE_PROJECT_VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_PROJECT_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_PROJECT_MINOR_VERSION})
@ -61,7 +60,7 @@ set(CPACK_RPM_PACKAGE_LICENSE "Apache-2.0")
set(CPACK_RPM_PACKAGE_URL ${PROJECT_HOMEPAGE_URL})
set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING.md")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
set(CPACK_SOURCE_IGNORE_FILES "build/;\\\\.gitmodules;\\\\.git/;\\\\.vscode;\\\\.editorconfig;\\\\.gitlab-ci.yml;\\\\.(docker|git)ignore;\\\\.DS_Store")

View file

@ -1,9 +1,8 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
set(CMAKE_CXX_FLAGS_COVERAGE
"${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage"

View file

@ -1,6 +1,5 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0

View file

@ -1,9 +1,8 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
set(CMAKE_CXX_FLAGS_PROFILING
"${CMAKE_CXX_FLAGS} -pg"

View file

@ -1,6 +1,10 @@
# CMakeLists.txt.
#
# @author Steffen Vogel <post@steffenvogel.de>
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
# @license Apache 2.0
###################################################################################
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
# don't treat warnings as errors on normal release builds
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND NOT DEFINED VILLAS_COMPILE_WARNING_AS_ERROR)
set(VILLAS_COMPILE_WARNING_AS_ERROR OFF)
endif()

View file

@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

View file

@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR armv7l)

1
common

@ -1 +0,0 @@
Subproject commit b18d2aca5b9a158aaba3a0f82cffe253fc427b15

38
common/CMakeLists.txt Normal file
View file

@ -0,0 +1,38 @@
## CMakeLists.txt
#
# Author: Steffen Vogel <post@steffenvogel.de>
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
include(FindPkgConfig)
include(FeatureSummary)
include(GNUInstallDirs)
# Check packages
find_package(OpenSSL 1.0.0 REQUIRED)
find_package(CURL 7.29 REQUIRED)
find_package(spdlog 1.6.0 REQUIRED)
find_package(fmt 6.0.0 REQUIRED)
find_package(Criterion)
pkg_check_modules(JANSSON IMPORTED_TARGET REQUIRED jansson>=2.7)
pkg_check_modules(LIBCONFIG IMPORTED_TARGET libconfig>=1.4.9)
pkg_check_modules(UUID IMPORTED_TARGET REQUIRED uuid>=2.23)
if(fmt_VERSION VERSION_LESS "9.0.0")
message("Using legacy ostream formatting")
set(FMT_LEGACY_OSTREAM_FORMATTER 1)
endif()
add_subdirectory(lib)
if(WITH_TESTS)
add_subdirectory(tests)
endif()
# Disable any colored log output
option(LOG_COLOR_DISABLE "Disable any colored log output" OFF)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/villas/config.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/include/villas/config.hpp
)

View file

@ -0,0 +1,51 @@
/* Various helper functions.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
// The suffixed of the BOX_ macro a constructed by
// combining the following letters in the written order:
// - U for a line facing upwards
// - D for a line facing downwards
// - L for a line facing leftwards
// - R for a line facing rightwards
//
// E.g. a cross can be constructed by combining all line fragments:
// BOX_UDLR
#if 0 // Alternate character set
#define BOX(chr) "\e(0" chr "\e(B"
#define BOX_LR BOX("\x71") // Boxdrawing: ─
#define BOX_UD BOX("\x78") // Boxdrawing: │
#define BOX_UDR BOX("\x74") // Boxdrawing: ├
#define BOX_UDLR BOX("\x6E") // Boxdrawing: ┼
#define BOX_UDL BOX("\x75") // Boxdrawing: ┤
#define BOX_ULR BOX("\x76") // Boxdrawing: ┴
#define BOX_UL BOX("\x6A") // Boxdrawing: ┘
#define BOX_DLR BOX("\x77") // Boxdrawing: ┘
#define BOX_DL BOX("\x6B") // Boxdrawing: ┘
#elif 1 // UTF-8
#define BOX_LR "─" // Boxdrawing: ─
#define BOX_UD "│" // Boxdrawing: │
#define BOX_UDR "├" // Boxdrawing: ├
#define BOX_UDLR "┼" // Boxdrawing: ┼
#define BOX_UDL "┤" // Boxdrawing: ┤
#define BOX_ULR "┴" // Boxdrawing: ┴
#define BOX_UL "┘" // Boxdrawing: ┘
#define BOX_DLR "┬" // Boxdrawing: ┘
#define BOX_DL "┐" // Boxdrawing: ┘
#define BOX_UR "└" // Boxdrawing: └
#else // ASCII
#define BOX_LR "-" // Boxdrawing: ─
#define BOX_UD "|" // Boxdrawing: │
#define BOX_UDR "+" // Boxdrawing: ├
#define BOX_UDLR "+" // Boxdrawing: ┼
#define BOX_UDL "+" // Boxdrawing: ┤
#define BOX_ULR "+" // Boxdrawing: ┴
#define BOX_UL "+" // Boxdrawing: ┘
#define BOX_DLR "+" // Boxdrawing: ┘
#define BOX_DL "+" // Boxdrawing: ┘
#endif

View file

@ -0,0 +1,37 @@
/* A simple buffer for encoding streamed JSON messages.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <vector>
#include <cstdlib>
#include <jansson.h>
namespace villas {
class Buffer : public std::vector<char> {
protected:
static int callback(const char *data, size_t len, void *ctx);
public:
Buffer(const char *buf, size_type len) : std::vector<char>(buf, buf + len) {}
Buffer(size_type count = 0) : std::vector<char>(count, 0) {}
// Encode JSON document /p j and append it to the buffer
int encode(json_t *j, int flags = 0);
// Decode JSON document from the beginning of the buffer
json_t *decode();
void append(const char *data, size_t len) { insert(end(), data, data + len); }
};
} // namespace villas

View file

@ -0,0 +1,31 @@
/* Various helper functions.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2017 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <villas/config.hpp>
// CPP stringification
#define XSTR(x) STR(x)
#define STR(x) #x
// Some color escape codes for pretty log messages
#ifdef LOG_COLOR_DISABLE
#define CLR(clr, str) str
#else
#define CLR(clr, str) "\e[" XSTR(clr) "m" str "\e[0m"
#endif
#define CLR_GRY(str) CLR(30, str) // Print str in gray
#define CLR_RED(str) CLR(31, str) // Print str in red
#define CLR_GRN(str) CLR(32, str) // Print str in green
#define CLR_YEL(str) CLR(33, str) // Print str in yellow
#define CLR_BLU(str) CLR(34, str) // Print str in blue
#define CLR_MAG(str) CLR(35, str) // Print str in magenta
#define CLR_CYN(str) CLR(36, str) // Print str in cyan
#define CLR_WHT(str) CLR(37, str) // Print str in white
#define CLR_BLD(str) CLR(1, str) // Print str in bold

View file

@ -0,0 +1,36 @@
/* Some common defines, enums and datastructures.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <string>
// Common states for most objects in VILLAScommon (paths, nodes, hooks, plugins)
enum class State {
DESTROYED = 0,
INITIALIZED = 1,
PARSED = 2,
CHECKED = 3,
STARTED = 4,
STOPPED = 5,
PENDING_CONNECT = 6,
CONNECTED = 7,
PAUSED = 8,
STARTING = 9,
STOPPING = 10,
PAUSING = 11,
RESUMING = 12,
PREPARED = 13
};
// Callback to destroy list elements.
//
// @param data A pointer to the data which should be freed.
typedef int (*dtor_cb_t)(void *);
// Convert state enum to human readable string.
std::string stateToString(enum State s);

View file

@ -0,0 +1,44 @@
/* Compatability for different library versions.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <jansson.h>
#include <villas/config.hpp>
#if JANSSON_VERSION_HEX < 0x020A00
size_t json_dumpb(const json_t *json, char *buffer, size_t size, size_t flags);
int json_dumpfd(const json_t *json, int output, size_t flags);
json_t *json_loadfd(int input, size_t flags, json_error_t *error);
#endif
#if defined(WITH_CONFIG) && (LIBCONFIG_VER_MAJOR <= 1) && \
(LIBCONFIG_VER_MINOR < 5)
#include <libconfig.h>
#define config_setting_lookup config_lookup_from
#endif
#ifdef __MACH__
#include <libkern/OSByteOrder.h>
#define le16toh(x) OSSwapLittleToHostInt16(x)
#define le32toh(x) OSSwapLittleToHostInt32(x)
#define le64toh(x) OSSwapLittleToHostInt64(x)
#define be16toh(x) OSSwapBigToHostInt16(x)
#define be32toh(x) OSSwapBigToHostInt32(x)
#define be64toh(x) OSSwapBigToHostInt64(x)
#define htole16(x) OSSwapHostToLittleInt16(x)
#define htole32(x) OSSwapHostToLittleInt32(x)
#define htole64(x) OSSwapHostToLittleInt64(x)
#define htobe16(x) OSSwapHostToBigInt16(x)
#define htobe32(x) OSSwapHostToBigInt32(x)
#define htobe64(x) OSSwapHostToBigInt64(x)
#endif // __MACH__

View file

@ -0,0 +1,52 @@
/** Compile time configuration
*
* This file contains some compiled-in settings.
* This settings are not part of the configuration file.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*********************************************************************************/
#pragma once
#define PROJECT_VERSION_STR "@CMAKE_PROJECT_VERSION_STR@"
#define PROJECT_VERSION "@CMAKE_PROJECT_VERSION@"
#define PROJECT_MAJOR_VERSION @CMAKE_PROJECT_MAJOR_VERSION@
#define PROJECT_MINOR_VERSION @CMAKE_PROJECT_MINOR_VERSION@
#define PROJECT_PATCH_VERSION @CMAKE_PROJECT_PATCH_VERSION@
#define PROJECT_RELEASE "@CMAKE_PROJECT_RELEASE@"
#define PROJECT_GIT_REV "@CMAKE_PROJECT_GIT_REV@"
#define PROJECT_GIT_BRANCH "@CMAKE_PROJECT_GIT_BRANCH@"
#define PROJECT_GIT_BRANCH_NORM "@CMAKE_PROJECT_GIT_BRANCH_NORM@"
#define PROJECT_VARIANT "@CMAKE_PROJECT_VARIANT@"
#define PROJECT_VARIANT_NORM "@CMAKE_PROJECT_VARIANT_NORM@"
#define PROJECT_BUILD_ID "@CMAKE_PROJECT_BUILD_ID@"
#define PROJECT_BUILD_DATE "@CMAKE_PROJECT_BUILD_DATE@"
#define PROJECT_HOMEPAGE_URL "@CMAKE_PROJECT_HOMEPAGE_URL@"
#define PROJECT_NAME "@CMAKE_PROJECT_DESCRIPTION@"
#define HTTP_USER_AGENT PROJECT_NAME " (" PROJECT_BUILD_ID ")"
// Hard-coded cache line size
#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
#define CACHELINE_SIZE 64
#else
#error "Unsupported architecture"
#endif
// Paths
#define PREFIX "@CMAKE_INSTALL_PREFIX@"
#define PLUGIN_PATH "@CMAKE_INSTALL_PREFIX@/share/villas/node/plugins"
#define SYSFS_PATH "/sys"
#define PROCFS_PATH "/proc"
// Width of log output in characters
#define LOG_WIDTH 80
#define LOG_HEIGHT 25
#cmakedefine LOG_COLOR_DISABLE
// Library Features
#cmakedefine FMT_LEGACY_OSTREAM_FORMATTER

View file

@ -0,0 +1,126 @@
/* Human readable cpusets.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#ifdef __linux__
#include <cstdint>
#include <sched.h>
#include <villas/exceptions.hpp>
namespace villas {
namespace utils {
class CpuSet {
protected:
cpu_set_t *setp;
unsigned num_cpus;
size_t sz;
public:
CpuSet() : num_cpus(sizeof(uintmax_t) * 8), sz(CPU_ALLOC_SIZE(num_cpus)) {
setp = CPU_ALLOC(num_cpus);
if (!setp)
throw MemoryAllocationError();
zero();
}
// Parses string with list of CPU ranges.
//
// @param str Human readable representation of the set.
CpuSet(const std::string &str);
CpuSet(const char *str);
// Convert integer to cpu_set_t.
//
// @param set An integer number which is used as the mask
CpuSet(uintmax_t set);
// Convert cpu_set_t to an integer. */
operator uintmax_t();
operator const cpu_set_t *() { return setp; }
// Returns human readable representation of the cpuset.
//
// The output format is a list of CPUs with ranges (for example, "0,1,3-9").
operator std::string();
~CpuSet() { CPU_FREE(setp); }
CpuSet(const CpuSet &src) : CpuSet(src.num_cpus) {
memcpy(setp, src.setp, sz);
}
bool empty() const { return count() == 0; }
bool full() const { return count() == num_cpus; }
unsigned count() const { return CPU_COUNT_S(sz, setp); }
void zero() { CPU_ZERO_S(sz, setp); }
size_t size() const { return sz; }
CpuSet operator~() {
CpuSet full = UINTMAX_MAX;
return full ^ *this;
}
bool operator==(const CpuSet &rhs) { return CPU_EQUAL_S(sz, setp, rhs.setp); }
CpuSet &operator&=(const CpuSet &rhs) {
CPU_AND_S(sz, setp, setp, rhs.setp);
return *this;
}
CpuSet &operator|=(const CpuSet &rhs) {
CPU_OR_S(sz, setp, setp, rhs.setp);
return *this;
}
CpuSet &operator^=(const CpuSet &rhs) {
CPU_XOR_S(sz, setp, setp, rhs.setp);
return *this;
}
friend CpuSet operator&(CpuSet lhs, const CpuSet &rhs) {
lhs &= rhs;
return lhs;
}
friend CpuSet operator|(CpuSet lhs, const CpuSet &rhs) {
lhs |= rhs;
return lhs;
}
friend CpuSet operator^(CpuSet lhs, const CpuSet &rhs) {
lhs ^= rhs;
return lhs;
}
bool operator[](size_t cpu) const { return isSet(cpu); }
bool isSet(size_t cpu) const { return CPU_ISSET_S(cpu, sz, setp); }
void clear(size_t cpu) { CPU_CLR_S(cpu, sz, setp); }
void set(size_t cpu) { CPU_SET_S(cpu, sz, setp); }
};
} // namespace utils
} // namespace villas
#endif

View file

@ -0,0 +1,32 @@
/* An exponential window.
*
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <villas/dsp/window.hpp>
namespace villas {
namespace dsp {
template <typename T> class ExponentialWindow {
protected:
T a;
T last;
public:
ExponentialWindow(T _a, T i = 0) : a(a), last(i) {}
T update(T in) {
last = a * in + (1 - a) * last;
return last;
}
};
} // namespace dsp
} // namespace villas

Some files were not shown because too many files have changed in this diff Show more