Skip to content

Commit

Permalink
Initial version of NDK Minimal Application
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubcabal committed Apr 11, 2022
0 parents commit db8506d
Show file tree
Hide file tree
Showing 80 changed files with 10,492 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
variables:
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive

image: python:3.7-alpine

pages:
stage: deploy
script:
- pip install -U sphinx
- pip install -U sphinx-rtd-theme
- pip install -U sphinx-vhdl
- sphinx-build -b html doc/source/ public
artifacts:
paths:
- public
only:
- main
18 changes: 18 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[submodule "ndk/ofm"]
path = ndk/ofm
url = ../ofm.git
[submodule "ndk/cards/agi-fh400g"]
path = ndk/cards/agi-fh400g
url = ../ndk-card-agi-fh400g.git
[submodule "ndk/modules/ndk-mod-dma-medusa"]
path = ndk/modules/ndk-mod-dma-medusa
url = ../ndk-mod-dma-medusa.git
[submodule "ndk/core"]
path = ndk/core
url = ../ndk-core.git
[submodule "ndk/cards/dk-dev-agi027res"]
path = ndk/cards/dk-dev-agi027res
url = ../ndk-card-dk-dev-agi027res.git
[submodule "ndk/cards/dk-dev-1sdx-p"]
path = ndk/cards/dk-dev-1sdx-p
url = ../ndk-card-dk-dev-1sdx-p.git
29 changes: 29 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2022, CESNET z.s.p.o.
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.

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.
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# NDK Minimal Application

The Network Development Kit (NDK) allows users to quickly and easily develop new network appliances based on FPGA acceleration cards. The NDK is optimized for high throughput and scalable to support up to 400 Gigabit Ethernet.

The Minimal application serves as a simple example of how to build an FPGA application using the Network Development Kit (NDK). It can also be used as a starting point for building your own application. The Minimal application does not process network packets in any way, it can only receive and send them. If the DMA module IP is enabled, the network packets are forwarded to the computer memory.

**The DMA module IP is not part of the open-source NDK. If the DMA module IP is disabled, then it is replaced by a loopback. [You can get NDK including DMA Module IP and professional support through our partner BrnoLogic](https://support.brnologic.com/)**

## Requirements

- To build FPGA firmware, you must have Intel Quartus Prime Pro 21.4 installed, including a valid license.
- Additional repositories (minimum - available as open-source) are needed to build the NDK design for the FPGA:
- [NDK Core](../../../../ndk-core/)
- [DK-DEV-1SDX-P card for NDK](../../../../ndk-card-dk-dev-1sdx-p/)
- [DK-DEV-AGI027RES card for NDK](../../../../ndk-card-dk-dev-agi027res/)
- [Open FPGA Modules](../../../../ofm/)
- NDK Linux driver and SW tools

### How to clone the necessary repositories

Anyone who wants to try the NDK-based Minimal application, which is available as open-source, must manually clone the repository with the selected (available) submodules:

```
git clone https://github.com/cesnet/ndk-app-minimal.git
git submodule update --init ndk/ofm
git submodule update --init ndk/core
git submodule update --init ndk/cards/dk-dev-1sdx-p
git submodule update --init ndk/cards/dk-dev-agi027res
```

CESNET developers who have access to closed-source repositories can use single command to clone a repository, including submodules (private GitLab):
```
git clone --recursive [email protected]:ndk/ndk-app-minimal.git
```

## Documentation

We use a documentation system based on the [Sphinx tool](https://www.sphinx-doc.org), which compiles complete documentation from source files in the [reStructuredText](https://docutils.sourceforge.io/rst.html) format. The documentation automatically build with each contribution to the devel branch and is available online here:
- [**Minimal NDK Application Docs (private GitLab)**](https://ndk.gitlab.liberouter.org:5051/ndk-app-minimal/).

### How to manually build documentation

First you need to install the sphinx package and theme in python:
```
$ pip3 install --user sphinx
$ pip3 install --user sphinx-vhdl
$ pip3 install --user sphinx_rtd_theme
```

Then the documentation should be able to be generated simply as follows:
```
$ cd doc
$ make html
```

The output is in `doc/build/index.html`

## License

Unless otherwise noted, the content of this repository is available under the BSD 3-Clause License. Please read [LICENSE file](LICENSE).

- See also the license information (in README.md) in each Git submodule.

## Repository Maintainer

- Jakub Cabal, [email protected]
22 changes: 22 additions & 0 deletions app/intel/DevTree.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
proc dts_application {base eth_streams mem_ports} {
set mi_ports [expr $eth_streams + $mem_ports]
set subaddr_w [expr 0x02000000 / $mi_ports]

set ret ""
append ret "nic_application {"
append ret "reg = <$base [expr $subaddr_w * $eth_streams]>;"
# TODO: why it was commented?
append ret "compatible = \"netcope,application,nic\";"

for {set i 0} {$i < $mem_ports} {incr i} {
set mem_tester_base [expr $base + $subaddr_w * ($eth_streams + $i)]
append ret "mem_tester_$i:" [mem_tester $mem_tester_base $i]
}

append ret "};"
return $ret
}

proc dts_build_project {} {
return [dts_build_netcope]
}
38 changes: 38 additions & 0 deletions app/intel/Modules.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Modules.tcl: script to compile single module
# Copyright (C) 2019 CESNET z. s. p. o.
# Author(s): Jakub Cabal <[email protected]>
#
# SPDX-License-Identifier: BSD-3-Clause

# Globally defined variables

# Auxiliary paths

# Component paths
set MI_ASYNC_BASE "$OFM_PATH/comp/mi_tools/async"
set MI_SPLITTER_BASE "$OFM_PATH/comp/mi_tools/splitter_plus_gen"
set MFB_PIPE_BASE "$OFM_PATH/comp/mfb_tools/flow/pipe"
set MFB_META_INS_BASE "$OFM_PATH/comp/mfb_tools/flow/metadata_insertor"
set MVB_PIPE_BASE "$OFM_PATH/comp/mvb_tools/flow/pipe"
set MVB_CHDIST_BASE "$OFM_PATH/comp/mvb_tools/flow/channel_router"
set MEM_TESTER_BASE "$OFM_PATH/comp/debug/mem_tester"


# Packages
set PACKAGES "$PACKAGES $OFM_PATH/comp/base/pkg/math_pack.vhd"
set PACKAGES "$PACKAGES $OFM_PATH/comp/base/pkg/eth_hdr_pack.vhd"

# Components
set COMPONENTS [concat $COMPONENTS [list \
[ list "MI_ASYNC" $MI_ASYNC_BASE "FULL" ]\
[ list "MI_SPLITTER" $MI_SPLITTER_BASE "FULL" ]\
[ list "MFB_META_INS" $MFB_META_INS_BASE "FULL" ]\
[ list "MFB_PIPE" $MFB_PIPE_BASE "FULL" ]\
[ list "MVB_PIPE" $MVB_PIPE_BASE "FULL" ]\
[ list "MVB_CHDIST" $MVB_CHDIST_BASE "FULL" ]\
[ list "MEM_TESTER" $MEM_TESTER_BASE "FULL" ]\
]]

set MOD "$MOD $ENTITY_BASE/app_subcore.vhd"
set MOD "$MOD $ENTITY_BASE/application_core.vhd"
set MOD "$MOD $ENTITY_BASE/DevTree.tcl"
Loading

0 comments on commit db8506d

Please sign in to comment.